MeVisLab Toolbox Reference
ml::BaseItemParser Class Reference

Parser class for BaseItem strings, containing an object's id and name. More...

#include <mlBaseItemParser.h>

Inheritance diagram for ml::BaseItemParser:
ml::ParserBase

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. More...
 
int getId (MLssize_t &id)
 Parse and return object id. More...
 
int getName (std::string &name)
 Parse and return object name. More...
 
const char * getErrorMessage (int errorCode) override
 Get error string for errorCode. More...
 
- Public Member Functions inherited from ml::ParserBase
 ParserBase ()
 Constructor. More...
 
virtual ~ParserBase ()
 Make destructor virtual to avoid warnings. More...
 
virtual int init (const char *source)
 Initialize parser and proceed to first non-whitespace character. More...
 
const char * getCurrentPos ()
 Get current parser position. More...
 
bool endOfSource ()
 Return end-of-source flag. More...
 

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. More...
 
static void deleteString (char *str)
 Dispose a string allocated with newString() More...
 
- Protected Member Functions inherited from ml::ParserBase
void skipWhitespace ()
 Proceed to next non-whitespace character. More...
 
- Protected Attributes inherited from ml::ParserBase
const char * _source
 Source string. More...
 
const char * _pNext
 Pointer to current parser position. More...
 
bool _eos
 End-of-string flag. More...
 

Detailed Description

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.

Member Enumeration Documentation

◆ anonymous enum

anonymous enum

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.

Constructor & Destructor Documentation

◆ BaseItemParser()

ml::BaseItemParser::BaseItemParser ( )
inline

Constructor.

Definition at line 41 of file mlBaseItemParser.h.

Member Function Documentation

◆ getErrorMessage()

const char* ml::BaseItemParser::getErrorMessage ( int  errorCode)
overridevirtual

Get error string for errorCode.

Reimplemented from ml::ParserBase.

◆ getId()

int ml::BaseItemParser::getId ( MLssize_t id)

Parse and return object id.

◆ getName()

int ml::BaseItemParser::getName ( std::string &  name)

Parse and return object name.


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