| IGLib 1.5 The IGLib base library for development of numerical, technical and business applications.

- Main Page
- Namespaces
- Classes
- Files

- Class List
- Class Index
- Class Hierarchy
- Class Members

All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Events
Public Member Functions | Protected Member Functions | Properties | Private Attributes | List of all members
IG.Lib.InterfaceInterpreterBase Class Reference

Base class for interfaces with interpreters. More...

Inheritance diagram for IG.Lib.InterfaceInterpreterBase:
[legend]
Collaboration diagram for IG.Lib.InterfaceInterpreterBase:
[legend]

## 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 = " */ "

## Detailed Description

Base class for interfaces with interpreters.

$A Igor Jul09;

## Constructor & Destructor Documentation

IG.Lib.InterfaceInterpreterBase.InterfaceInterpreterBase | ( |  | ) |
| inline

IG.Lib.InterfaceInterpreterBase.InterfaceInterpreterBase | ( | string | commandFileName | ) |
| inline

IG.Lib.InterfaceInterpreterBase.InterfaceInterpreterBase | ( | string | workingDirctory,
|  | string | commandFileName
| ) |  |
| inline

Constructor.

Parameters

  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.

IG.Lib.InterfaceInterpreterBase.InterfaceInterpreterBase | ( | string | commandDirectory,
|  | string | startDirectory,
|  | string | commandFileName
| ) |  |
| inline

Constructor.

Parameters

  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.

## Member Function Documentation

virtual void IG.Lib.InterfaceInterpreterBase.ResetCommands | ( |  | ) |
| inline virtual

virtual void IG.Lib.InterfaceInterpreterBase.Append | ( | string | str | ) |
| inline virtual

Appends a literal string to the contents of the command file plus a newline character.

Parameters

  str | String to be appended.

virtual void IG.Lib.InterfaceInterpreterBase.AppendLine | ( | string | str | ) |
| inline virtual

Appends a literal string to the contents of the command file.

Parameters

  str | String to be appended.

virtual void IG.Lib.InterfaceInterpreterBase.AppendLine | ( |  | ) |
| inline virtual

virtual void IG.Lib.InterfaceInterpreterBase.AppendIndent | ( |  | ) |
| inline virtual

Appends indentation to the contents of the command file.

virtual void IG.Lib.InterfaceInterpreterBase.AppendComment | ( | string | str,
|  | bool | withNewlines
| ) |  |
| inline virtual

Appends a vomment to the contents of the command file.

Parameters

  str | Comment text.
  withNewlines | Whether comment is appended in a separate line.

virtual void IG.Lib.InterfaceInterpreterBase.StartCodeBlock | ( |  | ) |
| inline virtual

Starts a new code block in the interpreter command file contents.

virtual void IG.Lib.InterfaceInterpreterBase.EndCodeBlock | ( |  | ) |
| inline virtual

Ends a code block in the interpreter command file contents.

virtual void IG.Lib.InterfaceInterpreterBase.StartCommand | ( | string | commandName | ) |
| inline virtual

Starts a new command in the interpreter command file contents.

Parameters

  commandName | Name of the command.

virtual void IG.Lib.InterfaceInterpreterBase.EndCommand | ( |  | ) |
| inline virtual

Ends (finalizes) a command in the interpreter command file contents.

virtual void IG.Lib.InterfaceInterpreterBase.AppendCommandArgumentSeparatorIfNecessary | ( |  | ) |
| inline virtual

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).

virtual void IG.Lib.InterfaceInterpreterBase.AppendValue | ( | int | value | ) |
| inline virtual

Appends an integer value to the interpreter command file contents.

Parameters

  value | Value to be appended.

virtual void IG.Lib.InterfaceInterpreterBase.AppendValue | ( | double | value | ) |
| inline virtual

Appends a double value to the interpreter command file contents.

Parameters

  value | Value to be appended.

virtual void IG.Lib.InterfaceInterpreterBase.AppendValue | ( | bool | value | ) |
| inline virtual

Appends a boolean value to the interpreter command file contents.

Parameters

  value | Value to be appended.

Reimplemented in IG.Lib.InterfaceInverse.

virtual void IG.Lib.InterfaceInterpreterBase.AppendValue | ( | string | value | ) |
| inline virtual

Appends a string value to the interpreter command file contents.

Parameters

  value | Value to be appended.

Reimplemented in IG.Lib.InterfaceInverse.

virtual void IG.Lib.InterfaceInterpreterBase.AppendValue | ( | IVector | value | ) |
| inline virtual

Appends a vector value to the interpreter command file contents.

Parameters

  value | Value to be appended.

Reimplemented in IG.Lib.InterfaceInverse.

virtual void IG.Lib.InterfaceInterpreterBase.AppendValue | ( | IMatrix | value | ) |
| inline virtual

Appends a matrix value to the interpreter command file contents.

Parameters

  value | Value to be appended.

Reimplemented in IG.Lib.InterfaceInverse.

virtual void IG.Lib.InterfaceInterpreterBase.AppendCommandVariableReference | ( | string | variableName | ) |
| inline protected virtual

Appends a variable reference to the contents of the interpreter command file.

Parameters

  value | Name of the variable whose reference is appended.

virtual void IG.Lib.InterfaceInterpreterBase.AppendCommandArgumentVariableReference | ( | string | variableName | ) |
| inline virtual

Appends a variable reference to the current argument block.

Parameters

  value | Name of the variable whose reference is appended.

virtual void IG.Lib.InterfaceInterpreterBase.AppendCommandArgument | ( | int | value | ) |
| inline virtual

Appends an integer argument to the command argument block of the interpreter command file.

Parameters

  value | Value of the argument that is appended.

virtual void IG.Lib.InterfaceInterpreterBase.AppendCommandArgument | ( | double | value | ) |
| inline virtual

Appends a double argument to the command argument block of the interpreter command file.

Parameters

  value | Value of the argument that is appended.

virtual void IG.Lib.InterfaceInterpreterBase.AppendCommandArgument | ( | bool | value | ) |
| inline virtual

Appends a boolean argument to the command argument block of the interpreter command file.

Parameters

  value | Value of the argument that is appended.

virtual void IG.Lib.InterfaceInterpreterBase.AppendCommandArgument | ( | string | value | ) |
| inline virtual

Appends a string argument to the command argument block of the interpreter command file.

Parameters

  value | Value of the argument that is appended.

virtual void IG.Lib.InterfaceInterpreterBase.AppendCommandArgumentPlain | ( | string | value | ) |
| inline virtual

Appends a plain string argument (without decoration such as double quotes) to the command argument block of the interpreter command file.

Parameters

  value | Value of the argument that is appended.

virtual void IG.Lib.InterfaceInterpreterBase.AppendCommandArgument | ( | IVector | value | ) |
| inline virtual

Appends a vector argument to the command argument block of the interpreter command file.

Parameters

  value | Value of the argument that is appended.

virtual void IG.Lib.InterfaceInterpreterBase.AppendCommandArgument | ( | IMatrix | value | ) |
| inline virtual

Appends a matrix argument to the command argument block of the interpreter command file.

Parameters

  value | Value of the argument that is appended.

virtual void IG.Lib.InterfaceInterpreterBase.WriteCommandFile | ( | bool | appendContents | ) |
| inline protected virtual

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.

Parameters

  appendContents | Whether file contents are appended.

virtual void IG.Lib.InterfaceInterpreterBase.WriteCommandFile | ( |  | ) |
| inline virtual

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.

virtual void IG.Lib.InterfaceInterpreterBase.WriteAppendToCommandFile | ( |  | ) |
| inline virtual

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.

virtual void IG.Lib.InterfaceInterpreterBase.RunCommandFile | ( |  | ) |
| inline protected virtual

Runs the interpreter command file.

virtual void IG.Lib.InterfaceInterpreterBase.WriteAndRunCommandFile | ( |  | ) |
| inline virtual

Writes interpreter command file and runs it. After this method is called, ResetCommands() should be called if the object will be further used.

## Member Data Documentation

object IG.Lib.InterfaceInterpreterBase._mainLock = new object()
| private

StringBuilder IG.Lib.InterfaceInterpreterBase._commandBuilder = new StringBuilder()
| private

string IG.Lib.InterfaceInterpreterBase._interpreterCommand
| private

string IG.Lib.InterfaceInterpreterBase._commandDirectory
| private

string IG.Lib.InterfaceInterpreterBase._startingDirectory
| private

string IG.Lib.InterfaceInterpreterBase._commandFileName
| private

string IG.Lib.InterfaceInterpreterBase._commandIndroduction = Environment.NewLine
| private

string IG.Lib.InterfaceInterpreterBase._commandArgumentBlockBegin = " ( " + Environment.NewLine + " "
| private

string IG.Lib.InterfaceInterpreterBase._commandArgumentBlockEnd = " ) " + Environment.NewLine
| private

string IG.Lib.InterfaceInterpreterBase._commandArgumentSeparator = ", "
| private

bool IG.Lib.InterfaceInterpreterBase._commandArgumentsInNewLines = true
| private

int IG.Lib.InterfaceInterpreterBase._commandArgumentCount = 0
| private

bool IG.Lib.InterfaceInterpreterBase._isWithinArgumentBlock = false
| private

string IG.Lib.InterfaceInterpreterBase._codeBlockBegin = Environment.NewLine + "{" + Environment.NewLine
| private

string IG.Lib.InterfaceInterpreterBase._codeBlockEnd = Environment.NewLine + "}" + Environment.NewLine
| private

string IG.Lib.InterfaceInterpreterBase._variableReferenceBegin = "$"
| private

string IG.Lib.InterfaceInterpreterBase._variableReferenceEnd = ""
| private

string IG.Lib.InterfaceInterpreterBase._indentationString = " "
| private

int IG.Lib.InterfaceInterpreterBase._indentationLevel = 0
| private

string IG.Lib.InterfaceInterpreterBase._commentBegin = "/* "
| private

string IG.Lib.InterfaceInterpreterBase._commentEnd = " */ "
| private

## Property Documentation

object IG.Lib.InterfaceInterpreterBase.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.

virtual StringBuilder IG.Lib.InterfaceInterpreterBase.CommandBuilder
| get protected set

Command builder.

virtual string IG.Lib.InterfaceInterpreterBase.CommandFileString
| get

Gets current state of commands as stirng.

virtual string IG.Lib.InterfaceInterpreterBase.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.

virtual string IG.Lib.InterfaceInterpreterBase.CommandDirectory
| get protected set

Gets or sets the directory where command file will be located.

virtual string IG.Lib.InterfaceInterpreterBase.DefaultCommandFileName
| get

Gets the default command file name for the current interpreter.

virtual string IG.Lib.InterfaceInterpreterBase.CommandFileName
| get protected set

Gets or sets the command file name where interpreter commands will be written.

virtual string IG.Lib.InterfaceInterpreterBase.CommandFilePath
| get

Gets path to command file.

virtual string IG.Lib.InterfaceInterpreterBase.StartingDirectory
| get protected set

Gets or sets the command that invokes the interpreter.

virtual string IG.Lib.InterfaceInterpreterBase.CommandIntroduction
| get protected set

String that introduces a new command (and is written before the command name in the command file). Usually a newline.

virtual string IG.Lib.InterfaceInterpreterBase.CommandArgumentBlockBegin
| get protected set

String that begins command arguments block.

virtual string IG.Lib.InterfaceInterpreterBase.CommandArgumentBlockEnd
| get protected set

String that ends command argument block.

virtual string IG.Lib.InterfaceInterpreterBase.CommandArgumentSeparator
| get protected set

String that begins command arguments block.

virtual bool IG.Lib.InterfaceInterpreterBase.CommandArgumentsInNewLines
| get set

Whether command arguments are listed in separate lines or not.

virtual int IG.Lib.InterfaceInterpreterBase.CommandArgumentCount
| get protected set

The number of current argument.

virtual bool IG.Lib.InterfaceInterpreterBase.IsWithinArgumentBlock
| get protected set

The number of current argument.

virtual string IG.Lib.InterfaceInterpreterBase.CodeBlockBegin
| get protected set

String that begins a code block in interpreted files.

virtual string IG.Lib.InterfaceInterpreterBase.CodeBlockEnd
| get protected set

String that ends a code block in interpreted files.

virtual string IG.Lib.InterfaceInterpreterBase.VariableReferenceBegin
| get protected set

String that begins a code block in interpreted files.

virtual string IG.Lib.InterfaceInterpreterBase.VariableReferenceEnd
| get protected set

String that ends a code block in interpreted files.

virtual string IG.Lib.InterfaceInterpreterBase.IndentationString
| get set

String used for indentation of code.

virtual int IG.Lib.InterfaceInterpreterBase.IndentationLevel
| get protected set

Indentation level - how many indentation strings are added before each new row.

virtual string IG.Lib.InterfaceInterpreterBase.CommentBegin
| get protected set

String that begins a comment.

virtual string IG.Lib.InterfaceInterpreterBase.CommentEnd
| get protected set

String that ends a comment.

The documentation for this class was generated from the following file:

- igbase/interpreters/interfaces/InterfaceInterpreterBase.cs