C# Class SoundLibrary.Command.CommandParser

テキストストリームから入力されたコマンドの解釈を行うクラス。
Datei anzeigen Open project: ufcpp/UfcppSample

Public Methods

Method Description
Add ( string command, CommandHandlar ope ) : void

コマンドを追加する。

Add ( string command, CommandHandlar ope, string help ) : void

コマンドを追加する。

CommandParser ( ) : System

初期化。 区切り文字に空白文字 ("\s+") を使用。 リダイレクト用に > (\s*>\s*) を使用。

CommandParser ( string prompt, string delim1, string delim2, string delim3 ) : System

初期化。 コマンド、引数間の区切り文字(正規表現)を指定。

Parse ( ) : bool

標準入力ストリームからコマンドを読み出して解釈。

Parse ( TextReader sin ) : bool

ストリームからコマンドを読み出して解釈。 標準出力ストリームに出力。

Parse ( TextReader sin, TextWriter sout ) : bool

ストリームからコマンドを読み出して解釈。

Remove ( string command ) : void

コマンドを削除する。

Private Methods

Method Description
DefaultNotFound ( string args, TextWriter sout ) : bool

コマンド未登録時、デフォルトの動作。

Parse ( string commandLine, TextWriter sout ) : bool

コマンドを1ライン解釈。

Quit ( string args, TextWriter sout ) : bool
SetNotFound ( CommandHandlar notFound ) : void

コマンド未登録時用デリゲートを登録。

ShowHelp ( string command, TextWriter sout ) : bool

各コマンドのヘルプ表示。

ShowHelp ( TextWriter sout ) : void

ヘルプ表示。

Source ( string args, TextWriter sout ) : bool

テキストファイルからコマンドを読み出す。

Method Details

Add() public method

コマンドを追加する。
public Add ( string command, CommandHandlar ope ) : void
command string コマンド名
ope CommandHandlar コマンド処理デリゲート
return void

Add() public method

コマンドを追加する。
public Add ( string command, CommandHandlar ope, string help ) : void
command string コマンド名
ope CommandHandlar コマンド処理デリゲート
help string ヘルプメッセージ
return void

CommandParser() public method

初期化。 区切り文字に空白文字 ("\s+") を使用。 リダイレクト用に > (\s*>\s*) を使用。
public CommandParser ( ) : System
return System

CommandParser() public method

初期化。 コマンド、引数間の区切り文字(正規表現)を指定。
public CommandParser ( string prompt, string delim1, string delim2, string delim3 ) : System
prompt string
delim1 string コマンドと引数の区切り文字
delim2 string 引数同士の間の区切り文字
delim3 string リダイレクト用の区切り文字
return System

Parse() public method

標準入力ストリームからコマンドを読み出して解釈。
public Parse ( ) : bool
return bool

Parse() public method

ストリームからコマンドを読み出して解釈。 標準出力ストリームに出力。
public Parse ( TextReader sin ) : bool
sin System.IO.TextReader 入力元
return bool

Parse() public method

ストリームからコマンドを読み出して解釈。
public Parse ( TextReader sin, TextWriter sout ) : bool
sin System.IO.TextReader 入力元
sout System.IO.TextWriter 出力先
return bool

Remove() public method

コマンドを削除する。
public Remove ( string command ) : void
command string コマンド名
return void