Rudiments
Public Member Functions | List of all members
sax Class Reference

Inherits object.

Inherited by csvsax, inisax, jsonsax, propsax, and xmlsax.

Public Member Functions

 sax ()
 
virtual ~sax ()
 
void setIgnoreHeaderLines (uint64_t lines)
 
uint64_t getIgnoreHeaderLines ()
 
void setIgnoreFooterLines (uint64_t lines)
 
uint64_t getIgnoreFooterLines ()
 
virtual bool parse (input *in)
 
virtual bool parseFile (const char *filename)
 
virtual bool parseString (const char *string)
 
const char * getError ()
 
- Public Member Functions inherited from object
virtual ~object ()
 

Detailed Description

The sax class is a base class for a SAX-style parser. To use this class, you should create a class that inherits from one if its immediate children and implements the protected virtual methods of that class.

Constructor & Destructor Documentation

◆ sax()

sax::sax ( )

Creates an instance of the sax class.

◆ ~sax()

virtual sax::~sax ( )
virtual

Deletes this instance of the sax class.

Member Function Documentation

◆ getError()

const char* sax::getError ( )

If parseFile() or parseString() fails, this method returns the error that caused the failure.

◆ getIgnoreFooterLines()

uint64_t sax::getIgnoreFooterLines ( )

Returns the value set by setIgnoreFooter() or 0 if none was set.

◆ getIgnoreHeaderLines()

uint64_t sax::getIgnoreHeaderLines ( )

Returns the value set by setIgnoreHeader() or 0 if none was set.

◆ parse()

virtual bool sax::parse ( input in)
virtual

Parses generic input "in" and calls the appropriate callback when tags, attributes, text, etc. are encountered.

Returns true on success or false otherwise.

Reimplemented in xmldom, propdom, jsondom, inidom, and csvdom.

◆ parseFile()

virtual bool sax::parseFile ( const char *  filename)
virtual

Parses file "filename" and calls the appropriate callback when tags, attributes, text, etc. are encountered.

Returns true on success or false otherwise.

Reimplemented in xmldom, propdom, jsondom, inidom, and csvdom.

◆ parseString()

virtual bool sax::parseString ( const char *  string)
virtual

Parses "string" and calls the appropriate callback when tags, attributes, text, etc. are encountered.

Returns true on success or false otherwise.

Reimplemented in xmldom, propdom, jsondom, inidom, and csvdom.

◆ setIgnoreFooterLines()

void sax::setIgnoreFooterLines ( uint64_t  lines)

Configures the instance to ignore the last "lines" lines of the data.

◆ setIgnoreHeaderLines()

void sax::setIgnoreHeaderLines ( uint64_t  lines)

Configures the instance to ignore the first "lines" lines and begin parsing after them.

If used in conjunction with setIgnoreHeaderUntil() then the lines specified here are ignored first, then lines are skipped until one begins with the pattern specified by setIgnoreHeaderUntil().