MeVisLabToolboxReference
|
Parser class for parsing persistent state strings of list objects. More...
#include <mlListParser.h>
Public Types | |
enum | { kMissingOpenBracket = kNumBaseErrorCodes, kMissingCloseBracket, kUnmatchedQuote, kNumErrorCodes } |
Error codes. More... | |
Public Member Functions | |
ListParser () | |
Constructor. | |
virtual int | init (const char *source) |
Initialize parser and proceed to first character of first item. | |
int | nextItemString (char *&itemString) |
Set itemString to next item's substring Return codes: | |
virtual const char * | getErrorMessage (int errorCode) |
Get error string for errorCode. | |
Static Public Member Functions | |
static bool | needsQuote (char *itemStr) |
Return true if itemStr needs to be quoted. | |
static char * | quoteString (char *itemStr) |
Return a quoted copy of itemStr allocated on the heap. | |
Protected Member Functions | |
int | unquoteString (std::string &itemString) |
Convert quoted string to original, unescaped character sequence Assumes that _pNext points to a leading quote, proceeds to the first character after the terminating quote. |
Parser class for parsing persistent state strings of list objects.
Definition at line 42 of file mlListParser.h.
anonymous enum |
Error codes.
kMissingOpenBracket | |
kMissingCloseBracket | |
kUnmatchedQuote | |
kNumErrorCodes |
Highest error code +1. |
Definition at line 69 of file mlListParser.h.
ml::ListParser::ListParser | ( | ) | [inline] |
Constructor.
Definition at line 47 of file mlListParser.h.
virtual const char* ml::ListParser::getErrorMessage | ( | int | errorCode | ) | [virtual] |
Get error string for errorCode.
Reimplemented from ml::ParserBase.
Referenced by ml::ListTemplate< T >::setPersistentState().
virtual int ml::ListParser::init | ( | const char * | source | ) | [virtual] |
Initialize parser and proceed to first character of first item.
Return codes:
Reimplemented from ml::ParserBase.
Referenced by ml::ListTemplate< T >::setPersistentState().
static bool ml::ListParser::needsQuote | ( | char * | itemStr | ) | [static] |
Return true if itemStr needs to be quoted.
int ml::ListParser::nextItemString | ( | char *& | itemString | ) |
Set itemString to next item's substring Return codes:
Referenced by ml::ListTemplate< T >::setPersistentState().
static char* ml::ListParser::quoteString | ( | char * | itemStr | ) | [static] |
Return a quoted copy of itemStr allocated on the heap.
int ml::ListParser::unquoteString | ( | std::string & | itemString | ) | [protected] |
Convert quoted string to original, unescaped character sequence Assumes that _pNext points to a leading quote, proceeds to the first character after the terminating quote.
Return kUnmatchedQuote if strings ends without terminating quote.