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 () const
void | setDelimiter (char delimiter)
char | getDelimiter () const
Public Member Functions inherited from sax
| sax ()
virtual | ~sax ()
virtual bool | parseFile (const char *filename)
virtual bool | parseString (const char *string)
const char * | getError ()

## 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 | ( |  | ) |
| protected virtual

Gets called when the end of the body is encountered.

Reimplemented in csvdom.

## ◆ bodyStart()

virtual bool csvsax::bodyStart | ( |  | ) |
| protected virtual

Gets called when the start of the body is encountered.

Reimplemented in csvdom.

## ◆ column()

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

Gets called when a column name is parsed.

Reimplemented in csvdom.

## ◆ field()

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

Gets called when a field is parsed.

Reimplemented in csvdom.

## ◆ getDelimiter()

char csvsax::getDelimiter | ( |  | ) | const

Returns the character that separates columns and fields.

## ◆ getQuote()

char csvsax::getQuote | ( |  | ) | const

Returns the character that optionally surrounds columns and fields.

## ◆ headerEnd()

virtual bool csvsax::headerEnd | ( |  | ) |
| protected virtual

Gets called when the end of the header is encountered.

Reimplemented in csvdom.

## ◆ headerStart()

virtual bool csvsax::headerStart | ( |  | ) |
| protected virtual

Gets called when the start of the header is encountered.

Reimplemented in csvdom.

## ◆ rowEnd()

virtual bool csvsax::rowEnd | ( |  | ) |
| protected virtual

Gets called when the end of a row is encountered.

Reimplemented in csvdom.

## ◆ rowStart()

virtual bool csvsax::rowStart | ( |  | ) |
| protected virtual

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".