Public Member Functions | Protected Member Functions | Private Member Functions | Private Attributes | List of all members
libebook::PDXParser Class Referenceabstract

`#include <PDXParser.h>`

Inheritance diagram for libebook::PDXParser:

## Public Member Functions
virtual | ~PDXParser ()=0
bool | parse ()
| Parse input and produce output to document. More...

## Protected Member Functions
| PDXParser (librevenge::RVNGInputStream *input, librevenge::RVNGTextInterface *document, unsigned type, unsigned creator)
| Instantiate a parser for a document in Palm Database Format. More...
librevenge::RVNGTextInterface * | getDocument () const
| Get the document generator used for this parsing run. More...
const char * | getName () const
librevenge::RVNGInputStream * | getAppInfoRecord () const
| Return a stream for the format's appInfo record, if it is present. More...
librevenge::RVNGInputStream * | getIndexRecord () const
| Return a stream for the format's index record. More...
unsigned | getDataRecordCount () const
| Return the number of data records in the document. More...
librevenge::RVNGInputStream * | getDataRecord (unsigned n) const
| Return a stream for the n-th data record. More...
librevenge::RVNGInputStream * | getDataRecords () const
| Return a stream for all data records. More...
librevenge::RVNGInputStream * | getDataRecords (unsigned first, unsigned last) const
| Return a stream for data records in a given range. More...

## Private Member Functions
| PDXParser (const PDXParser &other)
PDXParser & | operator= (const PDXParser &other)
virtual void | readAppInfoRecord (librevenge::RVNGInputStream *record)=0
virtual void | readSortInfoRecord (librevenge::RVNGInputStream *record)=0
virtual void | readIndexRecord (librevenge::RVNGInputStream *record)=0
virtual void | readDataRecord (librevenge::RVNGInputStream *record, bool last=false)=0
virtual void | readDataRecords ()
void | readHeader ()
librevenge::RVNGInputStream * | getRecordStream (unsigned n) const

## Private Attributes
boost::scoped_ptr< PDXParserImpl > | m_impl

## Constructor & Destructor Documentation

## § PDXParser() [1/2]

libebook::PDXParser::PDXParser | ( | const PDXParser & | other | ) |
| private

## § ~PDXParser()

libebook::PDXParser::~PDXParser | ( |  | ) |
| pure virtual

## § PDXParser() [2/2]

libebook::PDXParser::PDXParser | ( | librevenge::RVNGInputStream * | input,
|  | librevenge::RVNGTextInterface * | document,
|  | unsigned | type,
|  | unsigned | creator
| ) |  |
| protected

Instantiate a parser for a document in Palm Database Format.

- [in] input input stream
- [in] document output document generator
- [in] type the document type
- [in] creator the document creator

## Member Function Documentation

## § getAppInfoRecord()

librevenge::RVNGInputStream * libebook::PDXParser::getAppInfoRecord | ( |  | ) | const
| protected

Return a stream for the format's appInfo record, if it is present.

A parser for a subformat might want to peek into the appInfo record in isSupported().

Returns
  a newly allocated stream spanning the appInfo record or 0, if there is no appInfo record

## § getDataRecord()

librevenge::RVNGInputStream * libebook::PDXParser::getDataRecord | ( | unsigned | n | ) | const
| protected

Return a stream for the n-th data record.

- [in] n the stream number, 0-based
  Returns
    a newly allocated stream spanning one data record

Referenced by libebook::PLKRParser::readDataRecords(), libebook::PMLParser::readImages(), and libebook::PMLParser::readText().

## § getDataRecordCount()

unsigned libebook::PDXParser::getDataRecordCount | ( |  | ) | const
| protected

Return the number of data records in the document.

Returns
  the number of data records

Referenced by libebook::PLKRParser::readDataRecords(), libebook::PMLParser::readImages(), and libebook::TDParser::readIndexRecord().

## § getDataRecords() [1/2]

librevenge::RVNGInputStream * libebook::PDXParser::getDataRecords | ( |  | ) | const
| protected

Return a stream for all data records.

Returns
  a newly allocated stream spanning all data records

Referenced by libebook::ZTXTParser::readDataRecords(), and libebook::PMLParser::readText().

## § getDataRecords() [2/2]

librevenge::RVNGInputStream * libebook::PDXParser::getDataRecords | ( | unsigned | first,
|  | unsigned | last
| ) |  | const
| protected

Return a stream for data records in a given range.

- [in] first the first data record to include
- [in] last the first data record not to include

Returns
  a newly allocated stream spanning data records in a given range

## § getDocument()

librevenge::RVNGTextInterface * libebook::PDXParser::getDocument | ( |  | ) | const
| protected

Get the document generator used for this parsing run.

Returns
  the output document generator

Referenced by libebook::ZTXTParser::closeDocument(), libebook::TDParser::closeDocument(), libebook::PDBParser::closeDocument(), libebook::PMLParser::closeDocument(), libebook::PDBParser::closeParagraph(), libebook::PDBParser::handleCharacters(), libebook::ZTXTParser::handleText(), libebook::ZTXTParser::openDocument(), libebook::PDBParser::openDocument(), libebook::TDParser::openDocument(), libebook::PMLParser::openDocument(), libebook::PDBParser::openParagraph(), libebook::PLKRParser::readDataRecords(), and libebook::PMLParser::readText().

## § getIndexRecord()

librevenge::RVNGInputStream * libebook::PDXParser::getIndexRecord | ( |  | ) | const
| protected

Return a stream for the format's index record.

A parser for a subformat might want to peek into the index record in isSupported().

Returns
  a newly allocated stream spanning the index record

Referenced by libebook::PLKRParser::PLKRParser(), and libebook::PMLParser::PMLParser().

## § getName()

const char * libebook::PDXParser::getName | ( |  | ) | const
| protected

Referenced by libebook::ZTXTParser::openDocument(), libebook::PDBParser::openDocument(), and libebook::TDParser::openDocument().

## § getRecordStream()

librevenge::RVNGInputStream * libebook::PDXParser::getRecordStream | ( | unsigned | n | ) | const
| private

Referenced by getDataRecord(), getIndexRecord(), parse(), and readDataRecords().

## § operator=()

PDXParser& libebook::PDXParser::operator= | ( | const PDXParser & | other | ) |
| private

## § parse()

bool libebook::PDXParser::parse | ( |  | ) |

Parse input and produce output to document.

Returns
  true if the input has been parsed successfully.

## § readAppInfoRecord()

virtual void libebook::PDXParser::readAppInfoRecord | ( | librevenge::RVNGInputStream * | record | ) |
| private pure virtual

Implemented in libebook::PLKRParser, libebook::PDBParser, libebook::PMLParser, libebook::TDParser, libebook::MOBIParser, and libebook::ZTXTParser.

## § readDataRecord()

virtual void libebook::PDXParser::readDataRecord | ( | librevenge::RVNGInputStream * | record,
|  | bool | last = `false`
| ) |  |
| private pure virtual

Implemented in libebook::PLKRParser, libebook::PDBParser, libebook::PMLParser, libebook::TDParser, libebook::MOBIParser, and libebook::ZTXTParser.

Referenced by readDataRecords().

## § readDataRecords()

void libebook::PDXParser::readDataRecords | ( |  | ) |
| private virtual

Reimplemented in libebook::PLKRParser, libebook::PMLParser, and libebook::ZTXTParser.

Referenced by parse().

## § readHeader()

void libebook::PDXParser::readHeader | ( |  | ) |
| private

Referenced by PDXParser().

## § readIndexRecord()

virtual void libebook::PDXParser::readIndexRecord | ( | librevenge::RVNGInputStream * | record | ) |
| private pure virtual

Implemented in libebook::PLKRParser, libebook::PDBParser, libebook::PMLParser, libebook::TDParser, libebook::MOBIParser, and libebook::ZTXTParser.

Referenced by parse().

## § readSortInfoRecord()

virtual void libebook::PDXParser::readSortInfoRecord | ( | librevenge::RVNGInputStream * | record | ) |
| private pure virtual

Implemented in libebook::PLKRParser, libebook::PDBParser, libebook::PMLParser, libebook::TDParser, libebook::MOBIParser, and libebook::ZTXTParser.

## Member Data Documentation

## § m_impl

boost::scoped_ptr<PDXParserImpl> libebook::PDXParser::m_impl
| private

Referenced by getDataRecordCount(), getDataRecords(), getDocument(), getName(), getRecordStream(), parse(), PDXParser(), readDataRecords(), and readHeader().

The documentation for this class was generated from the following files:

- PDXParser.h
- PDXParser.cpp