![]() |
Open CASCADE Technology Reference Manual 8.0.0
|
Provides an encapsulation of the TCL interpreter to define Draw commands. More...
#include <Draw_Interpretor.hxx>
Data Structures | |
| struct | CallBackData |
| Callback for TCL (interface) More... | |
| struct | CallBackDataFunc |
| Callback implementation for global function definition. More... | |
| struct | CallBackDataMethod |
| Callback implementation for class's method definition. More... | |
Public Types | |
| typedef int(* | CommandFunction) (Draw_Interpretor &theDI, int theArgNb, const char **theArgVec) |
| Global callback function definition. | |
Public Member Functions | |
| Draw_Interpretor () | |
| Empty constructor. | |
| void | Init () |
| Initialize TCL interpreter. | |
| void | Add (const char *theCommandName, const char *theHelp, CommandFunction theFunction, const char *theGroup="User Commands") |
| Creates a new command with name <theCommandName>, help string <theHelp> in group <theGroup>. | |
| void | Add (const char *theCommandName, const char *theHelp, const char *theFileName, CommandFunction theFunction, const char *theGroup="User Commands") |
| Creates a new command with name <theCommandName>, help string <theHelp> in group <theGroup>. @theFunction callback implementation @theFileName the name of the file that contains the implementation of the command. | |
| template<typename theHandleType > | |
| void | Add (const char *theCommandName, const char *theHelp, const char *theFileName, const theHandleType &theObjPtr, typename Draw_Interpretor::CallBackDataMethod< theHandleType >::methodType theMethod, const char *theGroup) |
| Creates a new command with name <theCommandName>, help string <theHelp> in group <theGroup>. | |
| bool | Remove (const char *const theCommandName) |
| Removes <theCommandName>, returns true if success (the command existed). | |
| const char * | Result () const |
| void | Reset () |
| Resets the result to empty string. | |
| Draw_Interpretor & | Append (const char *const theResult) |
| Appends to the result. | |
| Draw_Interpretor & | operator<< (const char *const theResult) |
| Draw_Interpretor & | Append (const TCollection_AsciiString &theResult) |
| Appends to the result. | |
| Draw_Interpretor & | operator<< (const TCollection_AsciiString &theResult) |
| Draw_Interpretor & | Append (const TCollection_ExtendedString &theResult) |
| Appends to the result. | |
| Draw_Interpretor & | operator<< (const TCollection_ExtendedString &theResult) |
| Draw_Interpretor & | Append (const int theResult) |
| Appends to the result. | |
| Draw_Interpretor & | operator<< (const int theResult) |
| Draw_Interpretor & | Append (const size_t theResult) |
| Appends to the result. | |
| Draw_Interpretor & | operator<< (const size_t theResult) |
| Draw_Interpretor & | Append (const double theResult) |
| Appends to the result. | |
| Draw_Interpretor & | operator<< (const double theResult) |
| Draw_Interpretor & | Append (const Standard_SStream &theResult) |
| Appends to the result. | |
| Draw_Interpretor & | operator<< (const Standard_SStream &theResult) |
| void | AppendElement (const char *const theResult) |
| Appends to the result the string as a list element. | |
| int | Eval (const char *const theScript) |
| Eval the script and returns OK = 0, ERROR = 1. | |
| int | RecordAndEval (const char *const theScript, const int theFlags=0) |
| Eval the script and returns OK = 0, ERROR = 1 Store the script in the history record. | |
| int | EvalFile (const char *const theFileName) |
| Eval the content on the file and returns status. | |
| int | PrintHelp (const char *const theCommandName) |
| Eval the script "help command_name". | |
| ~Draw_Interpretor () | |
| Destructor. | |
| Draw_Interpretor (const Draw_PInterp &theInterp) | |
| void | Set (const Draw_PInterp &theInterp) |
| Draw_PInterp | Interp () const |
| void | SetDoLog (const bool theDoLog) |
| Enables or disables logging of all commands and their results. | |
| void | SetDoEcho (const bool theDoEcho) |
| Enables or disables eachoing of all commands and their results to cout. | |
| bool | GetDoLog () const |
| Returns true if logging of commands is enabled. | |
| bool | GetDoEcho () const |
| Returns true if echoing of commands is enabled. | |
| void | ResetLog () |
| Resets log (if opened) to zero size. | |
| void | AddLog (const char *const theStr) |
| Writes a text string to the log (if opened); end of line is not appended. | |
| TCollection_AsciiString | GetLog () |
| Returns current content of the log file as a text string. | |
| int | GetLogFileDescriptor () |
| Returns current value of the log file descriptor. | |
| bool | ToColorize () const |
| Return TRUE if console output should be colorized; TRUE by default. | |
| void | SetToColorize (bool theToColorize) |
| Set if console output should be colorized. | |
Static Public Member Functions | |
| static bool | Complete (const char *const theScript) |
| Returns True if the script is complete, no pending closing braces. (}) | |
Protected Member Functions | |
| void | add (const char *const theCommandName, const char *const theHelp, const char *const theFileName, CallBackData *theCallback, const char *const theGroup) |
Provides an encapsulation of the TCL interpreter to define Draw commands.
| typedef int(* Draw_Interpretor::CommandFunction) (Draw_Interpretor &theDI, int theArgNb, const char **theArgVec) |
Global callback function definition.
| Draw_Interpretor::Draw_Interpretor | ( | ) |
Empty constructor.
| Draw_Interpretor::~Draw_Interpretor | ( | ) |
Destructor.
| Draw_Interpretor::Draw_Interpretor | ( | const Draw_PInterp & | theInterp | ) |
|
protected |
|
inline |
Creates a new command with name <theCommandName>, help string <theHelp> in group <theGroup>.
| theFunction | callback implementation |
|
inline |
Creates a new command with name <theCommandName>, help string <theHelp> in group <theGroup>. @theFunction callback implementation @theFileName the name of the file that contains the implementation of the command.
|
inline |
Creates a new command with name <theCommandName>, help string <theHelp> in group <theGroup>.
| theObjPtr | callback class instance |
| theMethod | callback implementation |
| theFileName | the name of the file that contains the implementation of the command |
Writes a text string to the log (if opened); end of line is not appended.
| Draw_Interpretor & Draw_Interpretor::Append | ( | const char *const | theResult | ) |
Appends to the result.
| Draw_Interpretor & Draw_Interpretor::Append | ( | const double | theResult | ) |
Appends to the result.
| Draw_Interpretor & Draw_Interpretor::Append | ( | const int | theResult | ) |
Appends to the result.
| Draw_Interpretor & Draw_Interpretor::Append | ( | const size_t | theResult | ) |
Appends to the result.
| Draw_Interpretor & Draw_Interpretor::Append | ( | const Standard_SStream & | theResult | ) |
Appends to the result.
| Draw_Interpretor & Draw_Interpretor::Append | ( | const TCollection_AsciiString & | theResult | ) |
Appends to the result.
| Draw_Interpretor & Draw_Interpretor::Append | ( | const TCollection_ExtendedString & | theResult | ) |
Appends to the result.
Appends to the result the string as a list element.
Returns True if the script is complete, no pending closing braces. (})
Eval the script and returns OK = 0, ERROR = 1.
Eval the content on the file and returns status.
| bool Draw_Interpretor::GetDoEcho | ( | ) | const |
Returns true if echoing of commands is enabled.
| bool Draw_Interpretor::GetDoLog | ( | ) | const |
Returns true if logging of commands is enabled.
| TCollection_AsciiString Draw_Interpretor::GetLog | ( | ) |
Returns current content of the log file as a text string.
|
inline |
Returns current value of the log file descriptor.
| void Draw_Interpretor::Init | ( | ) |
Initialize TCL interpreter.
| Draw_PInterp Draw_Interpretor::Interp | ( | ) | const |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
Eval the script "help command_name".
Eval the script and returns OK = 0, ERROR = 1 Store the script in the history record.
Removes <theCommandName>, returns true if success (the command existed).
| void Draw_Interpretor::Reset | ( | ) |
Resets the result to empty string.
| void Draw_Interpretor::ResetLog | ( | ) |
Resets log (if opened) to zero size.
| const char * Draw_Interpretor::Result | ( | ) | const |
| void Draw_Interpretor::Set | ( | const Draw_PInterp & | theInterp | ) |
Enables or disables eachoing of all commands and their results to cout.
Enables or disables logging of all commands and their results.
Set if console output should be colorized.
|
inline |
Return TRUE if console output should be colorized; TRUE by default.