IGLib
1.7.2
The IGLib base library for development of numerical, technical and business applications.
|
Base class for interfaces with interpreters. More...
Public Member Functions | |
InterfaceInterpreterBase () | |
InterfaceInterpreterBase (string commandFileName) | |
InterfaceInterpreterBase (string workingDirctory, string commandFileName) | |
Constructor. More... | |
InterfaceInterpreterBase (string commandDirectory, string startDirectory, string commandFileName) | |
Constructor. More... | |
virtual void | ResetCommands () |
virtual void | Append (string str) |
Appends a literal string to the contents of the command file plus a newline character. More... | |
virtual void | AppendLine (string str) |
Appends a literal string to the contents of the command file. More... | |
virtual void | AppendLine () |
virtual void | AppendIndent () |
Appends indentation to the contents of the command file. More... | |
virtual void | AppendComment (string str, bool withNewlines) |
Appends a vomment to the contents of the command file. More... | |
virtual void | StartCodeBlock () |
Starts a new code block in the interpreter command file contents. More... | |
virtual void | EndCodeBlock () |
Ends a code block in the interpreter command file contents. More... | |
virtual void | StartCommand (string commandName) |
Starts a new command in the interpreter command file contents. More... | |
virtual void | EndCommand () |
Ends (finalizes) a command in the interpreter command file contents. More... | |
virtual void | AppendCommandArgumentSeparatorIfNecessary () |
Appends a command line separator to the interpreter command file contents, if necessary (i.e. if any arguments have already been written to the command file contents). More... | |
virtual void | AppendValue (int value) |
Appends an integer value to the interpreter command file contents. More... | |
virtual void | AppendValue (double value) |
Appends a double value to the interpreter command file contents. More... | |
virtual void | AppendValue (bool value) |
Appends a boolean value to the interpreter command file contents. More... | |
virtual void | AppendValue (string value) |
Appends a string value to the interpreter command file contents. More... | |
virtual void | AppendValue (IVector value) |
Appends a vector value to the interpreter command file contents. More... | |
virtual void | AppendValue (IMatrix value) |
Appends a matrix value to the interpreter command file contents. More... | |
virtual void | AppendCommandArgumentVariableReference (string variableName) |
Appends a variable reference to the current argument block. More... | |
virtual void | AppendCommandArgument (int value) |
Appends an integer argument to the command argument block of the interpreter command file. More... | |
virtual void | AppendCommandArgument (double value) |
Appends a double argument to the command argument block of the interpreter command file. More... | |
virtual void | AppendCommandArgument (bool value) |
Appends a boolean argument to the command argument block of the interpreter command file. More... | |
virtual void | AppendCommandArgument (string value) |
Appends a string argument to the command argument block of the interpreter command file. More... | |
virtual void | AppendCommandArgumentPlain (string value) |
Appends a plain string argument (without decoration such as double quotes) to the command argument block of the interpreter command file. More... | |
virtual void | AppendCommandArgument (IVector value) |
Appends a vector argument to the command argument block of the interpreter command file. More... | |
virtual void | AppendCommandArgument (IMatrix value) |
Appends a matrix argument to the command argument block of the interpreter command file. More... | |
virtual void | WriteCommandFile () |
Writes the current contents of the interpreter command file to the physical file. If the file exists then it is overwritten. After this method is called, ResetCommands() should be called if the object will be further used. More... | |
virtual void | WriteAppendToCommandFile () |
Appends the current contents of the interpreter command file to the physical file. After this method is called, ResetCommands() should be called if the object will be further used. More... | |
virtual void | WriteAndRunCommandFile () |
Writes interpreter command file and runs it. After this method is called, ResetCommands() should be called if the object will be further used. More... | |
Protected Member Functions | |
virtual void | AppendCommandVariableReference (string variableName) |
Appends a variable reference to the contents of the interpreter command file. More... | |
virtual void | WriteCommandFile (bool appendContents) |
Writes the current contents of the interpreter command file to the physical file. After this method is called, ResetCommands() should be called if the object will be further used. More... | |
virtual void | RunCommandFile () |
Runs the interpreter command file. More... | |
Properties | |
object | Lock [get] |
This object's central lock object to be used by other object. Do not use this object for locking in class' methods, for this you should use InternalLock. More... | |
virtual StringBuilder | CommandBuilder [get, protected set] |
Command builder. More... | |
virtual string | CommandFileString [get] |
Gets current state of commands as stirng. More... | |
virtual string | InterpreterCommand [get, protected set] |
Gets or sets the command that invokes the interpreter. This may be a full path to the executable, or only executable name if the executable is located in a directory included in path. More... | |
virtual string | CommandDirectory [get, protected set] |
Gets or sets the directory where command file will be located. More... | |
virtual string | DefaultCommandFileName [get] |
Gets the default command file name for the current interpreter. More... | |
virtual string | CommandFileName [get, protected set] |
Gets or sets the command file name where interpreter commands will be written. More... | |
virtual string | CommandFilePath [get] |
Gets path to command file. More... | |
virtual string | StartingDirectory [get, protected set] |
Gets or sets the command that invokes the interpreter. More... | |
virtual string | CommandIntroduction [get, protected set] |
String that introduces a new command (and is written before the command name in the command file). Usually a newline. More... | |
virtual string | CommandArgumentBlockBegin [get, protected set] |
String that begins command arguments block. More... | |
virtual string | CommandArgumentBlockEnd [get, protected set] |
String that ends command argument block. More... | |
virtual string | CommandArgumentSeparator [get, protected set] |
String that begins command arguments block. More... | |
virtual bool | CommandArgumentsInNewLines [get, set] |
Whether command arguments are listed in separate lines or not. More... | |
virtual int | CommandArgumentCount [get, protected set] |
The number of current argument. More... | |
virtual bool | IsWithinArgumentBlock [get, protected set] |
The number of current argument. More... | |
virtual string | CodeBlockBegin [get, protected set] |
String that begins a code block in interpreted files. More... | |
virtual string | CodeBlockEnd [get, protected set] |
String that ends a code block in interpreted files. More... | |
virtual string | VariableReferenceBegin [get, protected set] |
String that begins a code block in interpreted files. More... | |
virtual string | VariableReferenceEnd [get, protected set] |
String that ends a code block in interpreted files. More... | |
virtual string | IndentationString [get, set] |
String used for indentation of code. More... | |
virtual int | IndentationLevel [get, protected set] |
Indentation level - how many indentation strings are added before each new row. More... | |
virtual string | CommentBegin [get, protected set] |
String that begins a comment. More... | |
virtual string | CommentEnd [get, protected set] |
String that ends a comment. More... | |
Properties inherited from IG.Lib.ILockable | |
object | Lock [get] |
Private Attributes | |
object | _mainLock = new object() |
StringBuilder | _commandBuilder = new StringBuilder() |
string | _interpreterCommand |
string | _commandDirectory |
string | _startingDirectory |
string | _commandFileName |
string | _commandIndroduction = Environment.NewLine |
string | _commandArgumentBlockBegin = " ( " + Environment.NewLine + " " |
string | _commandArgumentBlockEnd = " ) " + Environment.NewLine |
string | _commandArgumentSeparator = ", " |
bool | _commandArgumentsInNewLines = true |
int | _commandArgumentCount = 0 |
bool | _isWithinArgumentBlock = false |
string | _codeBlockBegin = Environment.NewLine + "{" + Environment.NewLine |
string | _codeBlockEnd = Environment.NewLine + "}" + Environment.NewLine |
string | _variableReferenceBegin = "$" |
string | _variableReferenceEnd = "" |
string | _indentationString = " " |
int | _indentationLevel = 0 |
string | _commentBegin = "/* " |
string | _commentEnd = " */ " |
Base class for interfaces with interpreters.
$A Igor Jul09;
|
inline |
|
inline |
|
inline |
Constructor.
workingDirctory | Directory whre command file is written to and working directory for interpreter's application. Relative or absolute path. |
commandFileName | Name of the command file to which commands are written and which is interpreted by the interpreter. |
|
inline |
Constructor.
commandDirectory | Directory whre command file is written to. Relative or absolute path. |
startDirectory | Directory in which interpreter application is started. Relative or absolute path. |
commandFileName | Name of the command file to which commands are written and which is interpreted by the interpreter. |
|
inlinevirtual |
|
inlinevirtual |
Appends a literal string to the contents of the command file plus a newline character.
str | String to be appended. |
|
inlinevirtual |
Appends a literal string to the contents of the command file.
str | String to be appended. |
|
inlinevirtual |
|
inlinevirtual |
Appends indentation to the contents of the command file.
|
inlinevirtual |
Appends a vomment to the contents of the command file.
str | Comment text. |
withNewlines | Whether comment is appended in a separate line. |
|
inlinevirtual |
Starts a new code block in the interpreter command file contents.
|
inlinevirtual |
Ends a code block in the interpreter command file contents.
|
inlinevirtual |
Starts a new command in the interpreter command file contents.
commandName | Name of the command. |
|
inlinevirtual |
Ends (finalizes) a command in the interpreter command file contents.
|
inlinevirtual |
Appends a command line separator to the interpreter command file contents, if necessary (i.e. if any arguments have already been written to the command file contents).
|
inlinevirtual |
Appends an integer value to the interpreter command file contents.
value | Value to be appended. |
|
inlinevirtual |
Appends a double value to the interpreter command file contents.
value | Value to be appended. |
|
inlinevirtual |
Appends a boolean value to the interpreter command file contents.
value | Value to be appended. |
Reimplemented in IG.Lib.InterfaceInverse.
|
inlinevirtual |
Appends a string value to the interpreter command file contents.
value | Value to be appended. |
Reimplemented in IG.Lib.InterfaceInverse.
|
inlinevirtual |
Appends a vector value to the interpreter command file contents.
value | Value to be appended. |
Reimplemented in IG.Lib.InterfaceInverse.
|
inlinevirtual |
Appends a matrix value to the interpreter command file contents.
value | Value to be appended. |
Reimplemented in IG.Lib.InterfaceInverse.
|
inlineprotectedvirtual |
Appends a variable reference to the contents of the interpreter command file.
variableName | Name of the variable whose reference is appended. |
|
inlinevirtual |
Appends a variable reference to the current argument block.
variableName | Name of the variable whose reference is appended. |
|
inlinevirtual |
Appends an integer argument to the command argument block of the interpreter command file.
value | Value of the argument that is appended. |
|
inlinevirtual |
Appends a double argument to the command argument block of the interpreter command file.
value | Value of the argument that is appended. |
|
inlinevirtual |
Appends a boolean argument to the command argument block of the interpreter command file.
value | Value of the argument that is appended. |
|
inlinevirtual |
Appends a string argument to the command argument block of the interpreter command file.
value | Value of the argument that is appended. |
|
inlinevirtual |
Appends a plain string argument (without decoration such as double quotes) to the command argument block of the interpreter command file.
value | Value of the argument that is appended. |
|
inlinevirtual |
Appends a vector argument to the command argument block of the interpreter command file.
value | Value of the argument that is appended. |
|
inlinevirtual |
Appends a matrix argument to the command argument block of the interpreter command file.
value | Value of the argument that is appended. |
|
inlineprotectedvirtual |
Writes the current contents of the interpreter command file to the physical file. After this method is called, ResetCommands() should be called if the object will be further used.
appendContents | Whether file contents are appended. |
|
inlinevirtual |
Writes the current contents of the interpreter command file to the physical file. If the file exists then it is overwritten. After this method is called, ResetCommands() should be called if the object will be further used.
|
inlinevirtual |
Appends the current contents of the interpreter command file to the physical file. After this method is called, ResetCommands() should be called if the object will be further used.
|
inlineprotectedvirtual |
Runs the interpreter command file.
|
inlinevirtual |
Writes interpreter command file and runs it. After this method is called, ResetCommands() should be called if the object will be further used.
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
get |
This object's central lock object to be used by other object. Do not use this object for locking in class' methods, for this you should use InternalLock.
|
getprotected set |
Command builder.
|
get |
Gets current state of commands as stirng.
|
getprotected set |
Gets or sets the command that invokes the interpreter. This may be a full path to the executable, or only executable name if the executable is located in a directory included in path.
|
getprotected set |
Gets or sets the directory where command file will be located.
|
get |
Gets the default command file name for the current interpreter.
|
getprotected set |
Gets or sets the command file name where interpreter commands will be written.
|
get |
Gets path to command file.
|
getprotected set |
Gets or sets the command that invokes the interpreter.
|
getprotected set |
String that introduces a new command (and is written before the command name in the command file). Usually a newline.
|
getprotected set |
String that begins command arguments block.
|
getprotected set |
String that ends command argument block.
|
getprotected set |
String that begins command arguments block.
|
getset |
Whether command arguments are listed in separate lines or not.
|
getprotected set |
The number of current argument.
|
getprotected set |
The number of current argument.
|
getprotected set |
String that begins a code block in interpreted files.
|
getprotected set |
String that ends a code block in interpreted files.
|
getprotected set |
String that begins a code block in interpreted files.
|
getprotected set |
String that ends a code block in interpreted files.
|
getset |
String used for indentation of code.
|
getprotected set |
Indentation level - how many indentation strings are added before each new row.
|
getprotected set |
String that begins a comment.
|
getprotected set |
String that ends a comment.