1 <Type Name="ArgumentSource" FullName="Mono.Options.ArgumentSource">
2 <TypeSignature Language="C#" Value="public abstract class ArgumentSource" />
3 <TypeSignature Language="ILAsm" Value=".class public auto ansi abstract beforefieldinit ArgumentSource extends System.Object" />
5 <AssemblyName>Mono.Options</AssemblyName>
6 <AssemblyVersion>0.2.2.0</AssemblyVersion>
9 <BaseTypeName>System.Object</BaseTypeName>
14 Support for inserting additional arguments during
15 <see cref="M:Mono.Options.OptionSet.Parse(System.Collections.Generic.IEnumerable{System.String})" />
20 The <see cref="T:Mono.Options.ArgumentSource" /> type is an
21 abstraction to allow "insertion" of additional values for option
22 processing while processing arguments.
25 The principal use case is for <i>response files</i>, as used by
26 <c>CSC.EXE</c>, <c>CL.EXE</c>, and numerous other
27 compilers. A response file contains additional options for the tool,
28 and the contents of the response file should be "inserted" as if
29 entered on the command line. Response files are useful for bypassing
30 command-line length limitations, among other things.
33 Applications must opt-in to response file support by calling
34 <see cref="M:Mono.Options.OptionSet.Add(Mono.Options.ArgumentSource)" />
36 <see cref="M:Mono.Options.OptionSet.Parse(System.Collections.Generic.IEnumerable{System.String})" />.
38 <block subset="none" type="overrides">
39 Inheriting classes must override the following abstract methods:
40 <list type="bullet"><item><term><see cref="M:Mono.Options.ArgumentSource.GetNames" /></term></item><item><term><see cref="P:Mono.Options.ArgumentSource.Description" /></term></item><item><term><see cref="M:Mono.Options.ArgumentSource.GetArguments(System.Int32, System.Collections.Generic.IEnumerable{System.String}@)" /></term></item></list></block>
42 <altmember cref="T:Mono.Options.ResponseFileSource" />
45 <Member MemberName=".ctor">
46 <MemberSignature Language="C#" Value="protected ArgumentSource ();" />
47 <MemberSignature Language="ILAsm" Value=".method familyhidebysig specialname rtspecialname instance void .ctor() cil managed" />
48 <MemberType>Constructor</MemberType>
50 <AssemblyVersion>0.2.2.0</AssemblyVersion>
55 Construct and initialize a
56 <see cref="T:Mono.Options.ArgumentSource" /> instance.
62 <Member MemberName="Description">
63 <MemberSignature Language="C#" Value="public abstract string Description { get; }" />
64 <MemberSignature Language="ILAsm" Value=".property instance string Description" />
65 <MemberType>Property</MemberType>
67 <AssemblyVersion>0.2.2.0</AssemblyVersion>
70 <ReturnType>System.String</ReturnType>
74 The description to provide for the argument source within
75 <see cref="M:Mono.Options.OptionSet.WriteOptionDescriptions(System.IO.TextWriter)" />.
78 A <see cref="T:System.String" /> containing
79 the description to provide for the argument source within
80 <see cref="M:Mono.Options.OptionSet.WriteOptionDescriptions(System.IO.TextWriter)" />.
86 <Member MemberName="GetArguments">
87 <MemberSignature Language="C#" Value="public static System.Collections.Generic.IEnumerable<string> GetArguments (System.IO.TextReader reader);" />
88 <MemberSignature Language="ILAsm" Value=".method public static hidebysig class System.Collections.Generic.IEnumerable`1<string> GetArguments(class System.IO.TextReader reader) cil managed" />
89 <MemberType>Method</MemberType>
91 <AssemblyVersion>0.2.2.0</AssemblyVersion>
94 <ReturnType>System.Collections.Generic.IEnumerable<System.String></ReturnType>
97 <Parameter Name="reader" Type="System.IO.TextReader" />
100 <param name="reader">
101 A <see cref="T:System.IO.TextReader" /> to extract arguments from.
104 Extract arguments from a <see cref="T:System.IO.TextReader" />.
107 A <see cref="T:System.Collections.Generic.IEnumerable{System.String}" />
108 which will provide arguments extracted from <paramref name="reader" />.
112 Arguments are extracted from <paramref name="reader" /> by
113 splitting on newlines and spaces but maintaining the contents of
114 single-quoted and double-quoted strings. Thus, <c>A B</c> will be
115 split as the separate strings <c>"A", "B"</c>, while
116 <c>"A B"</c> will be returned as-is.
118 <block subset="none" type="note">
119 <paramref name="reader" /> is not
120 <see cref="M:System.IO>TextReader.Close" />d.
125 <Member MemberName="GetArguments">
126 <MemberSignature Language="C#" Value="public abstract bool GetArguments (string value, out System.Collections.Generic.IEnumerable<string> replacement);" />
127 <MemberSignature Language="ILAsm" Value=".method public hidebysig newslot virtual instance bool GetArguments(string value, class System.Collections.Generic.IEnumerable`1<string> replacement) cil managed" />
128 <MemberType>Method</MemberType>
130 <AssemblyVersion>0.2.2.0</AssemblyVersion>
133 <ReturnType>System.Boolean</ReturnType>
136 <Parameter Name="value" Type="System.String" />
137 <Parameter Name="replacement" Type="System.Collections.Generic.IEnumerable<System.String>&" RefType="out" />
141 A <see cref="T:System.String" /> containing the argument to replace
142 with additional arguments.
144 <param name="replacement">
145 A <see cref="T:System.Collections.Generic.IEnumerable{System.String}" />
146 which will refer to teh replacement arguments if this method returns
147 <see langword="true" />; otherwise, this value should be ignored by
151 Replace the argument <paramref name="value" /> with a set of
152 replacement arguments.
155 <see langword="true" /> if this
156 <see cref="T:Mono.Options.ArgumentSource" /> will replace
157 <paramref name="value" /> with a set of replacement strings and
158 <paramref name="replacement" /> contains the replacement strings;
159 otherwise, <see langword="false" />.
164 <see cref="M:Mono.Options.OptionSet.Parse(System.Collections.Generic.IEnumerable{System.String})" />
165 attempts to parse an argument as an option (or option value), all
166 registered <see cref="T:Mono.Options.OptionSet.ArgumentSources" />
167 are consulted in registration order to see if
168 <see cref="T:Mono.Options.ArgumentSource" /> "supports" the
170 <see cref="M:Mono.Options.ArgumentSource.GetArguments(System.Int32, System.Collections.Generic.IEnumerable{System.String}@)" />.
171 The first <c>ArgumentSource</c> to return <see langword="true" />
172 from <c>GetArguments()</c> may provide the replacement tokens, and
173 no later <c>ArgumentSource</c>es are consulted.
176 <altmember cref="M:Mono.Options.OptionSet.Parse(System.Collections.Generic.IEnumerable{System.String})" />
179 <Member MemberName="GetArgumentsFromFile">
180 <MemberSignature Language="C#" Value="public static System.Collections.Generic.IEnumerable<string> GetArgumentsFromFile (string file);" />
181 <MemberSignature Language="ILAsm" Value=".method public static hidebysig class System.Collections.Generic.IEnumerable`1<string> GetArgumentsFromFile(string file) cil managed" />
182 <MemberType>Method</MemberType>
184 <AssemblyVersion>0.2.2.0</AssemblyVersion>
187 <ReturnType>System.Collections.Generic.IEnumerable<System.String></ReturnType>
190 <Parameter Name="file" Type="System.String" />
194 A <see cref="T:System.String" /> containing the file to extract
198 Extract arguments from the specified filename.
201 A <see cref="T:System.Collections.Generic.IEnumerable{System.String}" />
202 which will provide arguments extracted from <paramref name="file" />.
206 <exception cref="T:System.IO.IOException">
207 <paramref name="file" /> could not be read.
209 <altmember cref="M:Mono.Options.ArgumentSource.GetArguments(System.IO.TextReader)" />
212 <Member MemberName="GetNames">
213 <MemberSignature Language="C#" Value="public abstract string[] GetNames ();" />
214 <MemberSignature Language="ILAsm" Value=".method public hidebysig newslot virtual instance string[] GetNames() cil managed" />
215 <MemberType>Method</MemberType>
217 <AssemblyVersion>0.2.2.0</AssemblyVersion>
220 <ReturnType>System.String[]</ReturnType>
225 The names to provide for the argument source within
226 <see cref="M:Mono.Options.OptionSet.WriteOptionDescriptions(System.IO.TextWriter)" />.
229 A <see cref="T:System.String" /> array containing
230 the names to provide for the argument source within
231 <see cref="M:Mono.Options.OptionSet.WriteOptionDescriptions(System.IO.TextWriter)" />.