MeVisLab Toolbox Reference
|
Basic parser class from which special parser classes can be derived for parsing persistent state strings. More...
#include <mlParserBase.h>
Public Types | |
enum | { kNoError = 0 , kEmptyString , kNumBaseErrorCodes , kEndOfSource = -1 } |
Error codes. More... | |
Public Member Functions | |
ParserBase () | |
Constructor. | |
virtual | ~ParserBase () |
Make destructor virtual to avoid warnings. | |
virtual int | init (const char *source) |
Initialize parser and proceed to first non-whitespace character. | |
const char * | getCurrentPos () |
Get current parser position. | |
bool | endOfSource () |
Return end-of-source flag. | |
virtual const char * | getErrorMessage (int errorCode) |
Get error string for errorCode. | |
Static Public Member Functions | |
static char * | newString (const std::string &str) |
Convenience method to create a copy of the string str allocated on the heap. | |
static void | deleteString (char *str) |
Dispose a string allocated with newString() | |
Protected Member Functions | |
void | skipWhitespace () |
Proceed to next non-whitespace character. | |
Protected Attributes | |
const char * | _source |
Source string. | |
const char * | _pNext |
Pointer to current parser position. | |
bool | _eos |
End-of-string flag. | |
Basic parser class from which special parser classes can be derived for parsing persistent state strings.
Definition at line 36 of file mlParserBase.h.
Error codes.
Enumerator | |
---|---|
kNoError | |
kEmptyString | Source string null or empty. |
kNumBaseErrorCodes | Highest error code +1. |
kEndOfSource | End of source reached. |
Definition at line 60 of file mlParserBase.h.
|
inline |
Constructor.
Definition at line 41 of file mlParserBase.h.
|
inlinevirtual |
Make destructor virtual to avoid warnings.
Definition at line 44 of file mlParserBase.h.
Dispose a string allocated with newString()
Referenced by ml::ListBase::deleteString().
|
inline |
Return end-of-source flag.
Definition at line 54 of file mlParserBase.h.
Get current parser position.
Definition at line 51 of file mlParserBase.h.
Get error string for errorCode.
Reimplemented in ml::BaseItemParser, and ml::ListParser.
Initialize parser and proceed to first non-whitespace character.
Returns kEmptyString for an empty or null source string.
Reimplemented in ml::ListParser.
Convenience method to create a copy of the string str allocated on the heap.
This avoids passing STL strings between modules, which fails in Windows due to a bug in the VC++ implementation of the STL.
Referenced by ml::ListBase::newString().
|
protected |
Proceed to next non-whitespace character.
|
protected |
End-of-string flag.
Definition at line 88 of file mlParserBase.h.
Pointer to current parser position.
Definition at line 86 of file mlParserBase.h.
Source string.
Definition at line 84 of file mlParserBase.h.