#include <CmdContext.h>
Public Member Functions | |
boolean | setDebug (boolean d) |
boolean | debug () |
boolean | setVerbose (boolean v) |
boolean | verbose () |
virtual void | pn (char *s)=0 |
virtual void | pn (char c)=0 |
virtual void | p (char *s)=0 |
virtual void | p (char c)=0 |
virtual char * | prompt ()=0 |
virtual char * | readLine (int &readError)=0 |
virtual char * | getClass (char *className)=0 |
virtual char * | getInstance (char *instanceName)=0 |
Private Attributes | |
boolean | debug_ |
boolean | verbose_ |
boolean CmdContext::setDebug | ( | boolean | d | ) |
change debugging flag
boolean CmdContext::debug | ( | ) |
return the current debug flag value.
boolean CmdContext::setVerbose | ( | boolean | v | ) |
change verbose messages
boolean CmdContext::verbose | ( | ) |
return verbosity message
virtual void CmdContext::pn | ( | char * | s | ) | [pure virtual] |
Writing a line
Implemented in CmdContextCCA.
virtual void CmdContext::pn | ( | char | c | ) | [pure virtual] |
Writing a character c
Implemented in CmdContextCCA.
virtual void CmdContext::p | ( | char * | s | ) | [pure virtual] |
Write a string w/out adding
Implemented in CmdContextCCA.
virtual void CmdContext::p | ( | char | c | ) | [pure virtual] |
Write a character w/out adding
Implemented in CmdContextCCA.
virtual char* CmdContext::prompt | ( | ) | [pure virtual] |
prompt string. not yours to delete or cache except by copy.
Implemented in CmdContextCCA.
virtual char* CmdContext::readLine | ( | int & | readError | ) | [pure virtual] |
Interpreter has to get input from somewhere, line at a time. Dearly wish this could support command and name completions. If 0 is returned, the value of readError is returned to the caller of CmdParse::parse() for the parser instance containing this cc.
Implemented in CmdContextCCA.
virtual char* CmdContext::getClass | ( | char * | className | ) | [pure virtual] |
Interpreter can define a restricted set of classes as qualified for command-line use. May return null. This takes care of changing approximate class names to exact, in some parsers. If a string is returned, it will be exactly defined in the CmdContext, but the partial-matching is not guaranteed unique. The returned string is owned by the context and the caller need not free/delete it.
Implemented in CmdContextCCA.
virtual char* CmdContext::getInstance | ( | char * | instanceName | ) | [pure virtual] |
Interpreter can define a restricted set of instances as qualified for command-line use. May return null. This takes care of changing approximate instance names to exact, in some parsers. If a string is returned, it will be exactly defined in the CmdContext, but the partial-matching is not guaranteed unique. The returned string is owned by the context and the caller need not free/delete it.
Implemented in CmdContextCCA.
boolean CmdContext::debug_ [private] |
every interpreter has a debug switch, which may or may not do much.
boolean CmdContext::verbose_ [private] |
every interpreter has a verbose switch for error message style.