#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. | |
Definition at line 36 of file mlParserBase.h.
| anonymous enum |
Error codes.
| 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.
| ml::ParserBase::ParserBase | ( | ) | [inline] |
| virtual ml::ParserBase::~ParserBase | ( | ) | [inline, virtual] |
| static void ml::ParserBase::deleteString | ( | char * | str | ) | [static] |
Dispose a string allocated with newString().
| bool ml::ParserBase::endOfSource | ( | ) | [inline] |
| const char* ml::ParserBase::getCurrentPos | ( | ) | [inline] |
| virtual const char* ml::ParserBase::getErrorMessage | ( | int | errorCode | ) | [virtual] |
| virtual int ml::ParserBase::init | ( | const char * | source | ) | [virtual] |
Initialize parser and proceed to first non-whitespace character.
Returns kEmptyString for an empty or null source string.
Reimplemented in ml::ListParser.
| static char* ml::ParserBase::newString | ( | const std::string & | str | ) | [static] |
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.
| void ml::ParserBase::skipWhitespace | ( | ) | [protected] |
Proceed to next non-whitespace character.
bool ml::ParserBase::_eos [protected] |
const char* ml::ParserBase::_pNext [protected] |
const char* ml::ParserBase::_source [protected] |
1.5.8