Rudiments
Public Member Functions | Protected Member Functions | List of all members
csvsax Class Reference

Inherits sax.

Inherited by csvdom.

Public Member Functions

 csvsax ()
 
virtual ~csvsax ()
 
void setQuote (char quote)
 
char getQuote ()
 
void setDelimiter (char delimiter)
 
char getDelimiter ()
 
- Public Member Functions inherited from sax
 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 ()
 

Protected Member Functions

virtual bool headerStart ()
 
virtual bool column (const char *name, bool quoted)
 
virtual bool headerEnd ()
 
virtual bool bodyStart ()
 
virtual bool rowStart ()
 
virtual bool field (const char *value, bool quoted)
 
virtual bool rowEnd ()
 
virtual bool bodyEnd ()
 

Detailed Description

The csvsax class is a base class for an SAX-style parser for CSV data. To use this class, you should create a class that inherits from it and implements its protected virtual methods.

Constructor & Destructor Documentation

◆ csvsax()

csvsax::csvsax ( )

Creates an instance of the csvsax class.

◆ ~csvsax()

virtual csvsax::~csvsax ( )
virtual

Deletes this instance of the csvsax class.

Member Function Documentation

◆ bodyEnd()

virtual bool csvsax::bodyEnd ( )
protectedvirtual

Gets called when the end of the body is encountered.

Reimplemented in csvdom.

◆ bodyStart()

virtual bool csvsax::bodyStart ( )
protectedvirtual

Gets called when the start of the body is encountered.

Reimplemented in csvdom.

◆ column()

virtual bool csvsax::column ( const char *  name,
bool  quoted 
)
protectedvirtual

Gets called when a column name is parsed.

Reimplemented in csvdom.

◆ field()

virtual bool csvsax::field ( const char *  value,
bool  quoted 
)
protectedvirtual

Gets called when a field is parsed.

Reimplemented in csvdom.

◆ getDelimiter()

char csvsax::getDelimiter ( )

Returns the character that separates columns and fields.

◆ getQuote()

char csvsax::getQuote ( )

Returns the character that optionally surrounds columns and fields.

◆ headerEnd()

virtual bool csvsax::headerEnd ( )
protectedvirtual

Gets called when the end of the header is encountered.

Reimplemented in csvdom.

◆ headerStart()

virtual bool csvsax::headerStart ( )
protectedvirtual

Gets called when the start of the header is encountered.

Reimplemented in csvdom.

◆ rowEnd()

virtual bool csvsax::rowEnd ( )
protectedvirtual

Gets called when the end of a row is encountered.

Reimplemented in csvdom.

◆ rowStart()

virtual bool csvsax::rowStart ( )
protectedvirtual

Gets called when the start of a row is encountered.

Reimplemented in csvdom.

◆ setDelimiter()

void csvsax::setDelimiter ( char  delimiter)

Sets the character that separates columns and fields to "delimiter".

◆ setQuote()

void csvsax::setQuote ( char  quote)

Sets the character that optionally surrounds columns and fields to "quote".