CommandLineParser クラス
コマンド行引数を解析します。 このクラスは静的クラスです。
継承
継承されたメンバー
名前空間: ExapisSOP.IO.Settings.CommandLine
アセンブリ: ExapisSOP.dll
構文
public static class CommandLineParser
メソッド 一覧
| 編集/提案 ソースを表示Convert(IArgumentConverter, IEnumerable<String>)
コマンド行引数をオブジェクトへ変換します。
宣言
public static object Convert(this IArgumentConverter converter, IEnumerable<string> args)
引数
型 | 名前 | 説明 |
---|---|---|
IArgument |
converter | 実際に変換を行うオブジェクトです。 |
System. |
args | コマンド行引数の全部または一部を表す文字列の列挙体です。 |
戻り値
型 | 説明 |
---|---|
System. |
変換結果を表す新しいオブジェクトです。 |
例外
型 | 条件 |
---|---|
System. |
Convert<T>(IArgumentConverter<T>, IEnumerable<String>)
コマンド行引数を指定された型'T
'へ変換します。
宣言
public static T Convert<T>(this IArgumentConverter<T> converter, IEnumerable<string> args)
引数
型 | 名前 | 説明 |
---|---|---|
IArgument |
converter | 実際に変換を行うオブジェクトです。 |
System. |
args | コマンド行引数の全部または一部を表す文字列配列です。 |
戻り値
型 | 説明 |
---|---|
T | 変換結果を表す新しい指定された型' |
型引数
名前 | 説明 |
---|---|
T | 変換後のオブジェクトです。 |
例外
型 | 条件 |
---|---|
System. |
DoShowHelp(Switch[])
コマンド行説明書を表示する事が求められているかどうかを表す論理値を取得します。
宣言
public static bool DoShowHelp(this Switch[] switches)
引数
型 | 名前 | 説明 |
---|---|---|
Switch[] | switches | コマンド行引数を表すスイッチの配列です。 |
戻り値
型 | 説明 |
---|---|
System. |
求められている場合はtrue、それ以外の場合はfalseを返します。 |
例外
型 | 条件 |
---|---|
System. |
DoShowVersion(Switch[])
バージョン情報を表示する事が求められているかどうかを表す論理値を取得します。
宣言
public static bool DoShowVersion(this Switch[] switches)
引数
型 | 名前 | 説明 |
---|---|---|
Switch[] | switches | コマンド行引数を表すスイッチの配列です。 |
戻り値
型 | 説明 |
---|---|
System. |
求められている場合はtrue、それ以外の場合はfalseを返します。 |
例外
型 | 条件 |
---|---|
System. |
GetCommandName(Switch[])
指定されたコマンド行引数を表すスイッチの配列からコマンド名を取得します。
宣言
public static string GetCommandName(this Switch[] switches)
引数
型 | 名前 | 説明 |
---|---|---|
Switch[] | switches | コマンド行引数を表すスイッチの配列です。 |
戻り値
型 | 説明 |
---|---|
System. |
コマンド行引数で指定されているコマンド名、または、指定されていない場合はnullを返します。 |
例外
型 | 条件 |
---|---|
System. |
GetValue<T>(IDictionary<Type, Object>)
Command
宣言
public static T GetValue<T>(this IDictionary<Type, object> converterResult)
引数
型 | 名前 | 説明 |
---|---|---|
System. |
converterResult | 変換結果を格納している辞書です。 |
戻り値
型 | 説明 |
---|---|
T | 指定された型の値が存在する場合は有効なインスタンス、 または、存在しない場合はnullを返します。 |
型引数
名前 | 説明 |
---|---|
T | 取得する値の種類です。 |
例外
型 | 条件 |
---|---|
System. |
Parse(IEnumerable<String>)
指定されたコマンド行引数を表す配列を解析し、スイッチの配列へ変換します。
宣言
public static Switch[] Parse(IEnumerable<string> args)
引数
型 | 名前 | 説明 |
---|---|---|
System. |
args | 解析するコマンド行引数を格納した列挙体です。 |
戻り値
型 | 説明 |
---|---|
Switch[] | 指定されたコマンド行引数と同じ内容を表すスイッチの配列です。 |
例外
型 | 条件 |
---|---|
System. |
Parse(String[])
指定されたコマンド行引数を表す配列を解析し、スイッチの配列へ変換します。
宣言
public static Switch[] Parse(params string[] args)
引数
型 | 名前 | 説明 |
---|---|---|
System. |
args | 解析するコマンド行引数を格納した配列です。 |
戻り値
型 | 説明 |
---|---|
Switch[] | 指定されたコマンド行引数と同じ内容を表すスイッチの配列です。 |
例外
型 | 条件 |
---|---|
System. |