13#ifndef ML_PARSER_BASE_H 
   14#define ML_PARSER_BASE_H 
   41  ParserBase () : _source(nullptr), _pNext(nullptr), _eos(true) {}
 
   48  virtual int init (
const char *source);
 
 
Basic parser class from which special parser classes can be derived for parsing persistent state stri...
 
const char * _pNext
Pointer to current parser position.
 
@ kNumBaseErrorCodes
Highest error code +1.
 
@ kEmptyString
Source string null or empty.
 
static char * newString(const std::string &str)
Convenience method to create a copy of the string str allocated on the heap.
 
const char * getCurrentPos()
Get current parser position.
 
virtual const char * getErrorMessage(int errorCode)
Get error string for errorCode.
 
static void deleteString(char *str)
Dispose a string allocated with newString()
 
bool _eos
End-of-string flag.
 
bool endOfSource()
Return end-of-source flag.
 
const char * _source
Source string.
 
virtual int init(const char *source)
Initialize parser and proceed to first non-whitespace character.
 
virtual ~ParserBase()
Make destructor virtual to avoid warnings.
 
void skipWhitespace()
Proceed to next non-whitespace character.
 
#define MLBASEEXPORT
defined Header file mlBaseInit.h