MeVisLab Toolbox Reference
|
Parser class for BaseItem strings, containing an object's id and name. More...
#include <mlBaseItemParser.h>
Public Types | |
enum | { kInvalidType = kNumBaseErrorCodes , kNumBaseItemErrorCodes } |
Error codes. More... | |
Public Types inherited from ml::ParserBase | |
enum | { kNoError = 0 , kEmptyString , kNumBaseErrorCodes , kEndOfSource = -1 } |
Error codes. More... | |
Public Member Functions | |
BaseItemParser () | |
Constructor. | |
int | getId (MLssize_t &id) |
Parse and return object id. | |
int | getName (std::string &name) |
Parse and return object name. | |
const char * | getErrorMessage (int errorCode) override |
Get error string for errorCode. | |
Public Member Functions inherited from ml::ParserBase | |
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. | |
Additional Inherited Members | |
Static Public Member Functions inherited from ml::ParserBase | |
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 inherited from ml::ParserBase | |
void | skipWhitespace () |
Proceed to next non-whitespace character. | |
Protected Attributes inherited from ml::ParserBase | |
const char * | _source |
Source string. | |
const char * | _pNext |
Pointer to current parser position. | |
bool | _eos |
End-of-string flag. | |
Parser class for BaseItem strings, containing an object's id and name.
The strings use the following syntax: ['#'id][[:]name] id = integer name = string
Definition at line 36 of file mlBaseItemParser.h.
Error codes.
Enumerator | |
---|---|
kInvalidType | |
kNumBaseItemErrorCodes | Highest error code +1, not to be used as error code enumerator! |
Definition at line 53 of file mlBaseItemParser.h.
|
inline |
Constructor.
Definition at line 41 of file mlBaseItemParser.h.
Get error string for errorCode.
Reimplemented from ml::ParserBase.
int ml::BaseItemParser::getName | ( | std::string & | name | ) |
Parse and return object name.