libebook::PDBParser Class Reference documentation

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

`#include <PDBParser.h>`

Inheritance diagram for libebook::PDBParser:

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

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

## Private Member Functions
| PDBParser (const PDBParser &other)
PDBParser & | operator= (const PDBParser &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
std::unique_ptr< PDBParserImpl > | m_impl

## Constructor & Destructor Documentation

## ◆ PDBParser() [1/2]

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

## ◆ ~PDBParser()

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

## ◆ PDBParser() [2/2]

libebook::PDBParser::PDBParser | ( | 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::PDBParser::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::PDBParser::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::PluckerParser::readDataRecords(), libebook::PeanutPressParser::readImages(), and libebook::PeanutPressParser::readText().

## ◆ getDataRecordCount()

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

Return the number of data records in the document.

Returns
  the number of data records

Referenced by libebook::PluckerParser::readDataRecords(), libebook::PeanutPressParser::readImages(), and libebook::TealDocParser::readIndexRecord().

## ◆ getDataRecords() [1/2]

librevenge::RVNGInputStream * libebook::PDBParser::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::PeanutPressParser::readText().

## ◆ getDataRecords() [2/2]

librevenge::RVNGInputStream * libebook::PDBParser::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::PDBParser::getDocument | ( |  | ) | const
| protected

Get the document generator used for this parsing run.

Returns
  the output document generator

Referenced by libebook::PalmDocParser::closeDocument(), libebook::PeanutPressParser::closeDocument(), libebook::TealDocParser::closeDocument(), libebook::ZTXTParser::closeDocument(), libebook::PalmDocParser::closeParagraph(), libebook::PalmDocParser::handleCharacters(), libebook::ZTXTParser::handleText(), libebook::PalmDocParser::openDocument(), libebook::PeanutPressParser::openDocument(), libebook::TealDocParser::openDocument(), libebook::ZTXTParser::openDocument(), libebook::PalmDocParser::openParagraph(), libebook::PluckerParser::readDataRecords(), and libebook::PeanutPressParser::readText().

## ◆ getIndexRecord()

librevenge::RVNGInputStream * libebook::PDBParser::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::PeanutPressParser::PeanutPressParser(), and libebook::PluckerParser::PluckerParser().

## ◆ getName()

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

Referenced by libebook::PalmDocParser::openDocument(), libebook::TealDocParser::openDocument(), libebook::ZTXTParser::openDocument(), and libebook::PalmDocParser::readDataRecord().

## ◆ getRecordStream()

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

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

## ◆ operator=()

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

## ◆ parse()

bool libebook::PDBParser::parse | ( |  | ) |

Parse input and produce output to document.

Returns
  true if the input has been parsed successfully.

## ◆ readAppInfoRecord()

virtual void libebook::PDBParser::readAppInfoRecord | ( | librevenge::RVNGInputStream * | record | ) |
| privatepure virtual

Implemented in libebook::MobiPocketParser, libebook::PalmDocParser, libebook::PeanutPressParser, libebook::PluckerParser, libebook::TealDocParser, and libebook::ZTXTParser.

## ◆ readDataRecord()

virtual void libebook::PDBParser::readDataRecord | ( | librevenge::RVNGInputStream * | record,
|  | bool | last = `false`
| ) |  |
| privatepure virtual

Implemented in libebook::PalmDocParser, libebook::TealDocParser, libebook::MobiPocketParser, libebook::PeanutPressParser, libebook::PluckerParser, and libebook::ZTXTParser.

Referenced by readDataRecords().

## ◆ readDataRecords()

void libebook::PDBParser::readDataRecords | ( |  | ) |
| privatevirtual

Reimplemented in libebook::PeanutPressParser, libebook::PluckerParser, and libebook::ZTXTParser.

Referenced by parse().

## ◆ readHeader()

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

Referenced by PDBParser().

## ◆ readIndexRecord()

virtual void libebook::PDBParser::readIndexRecord | ( | librevenge::RVNGInputStream * | record | ) |
| privatepure virtual

Implemented in libebook::MobiPocketParser, libebook::PalmDocParser, libebook::PeanutPressParser, libebook::PluckerParser, libebook::TealDocParser, and libebook::ZTXTParser.

Referenced by parse().

## ◆ readSortInfoRecord()

virtual void libebook::PDBParser::readSortInfoRecord | ( | librevenge::RVNGInputStream * | record | ) |
| privatepure virtual

Implemented in libebook::MobiPocketParser, libebook::PalmDocParser, libebook::PeanutPressParser, libebook::PluckerParser, libebook::TealDocParser, and libebook::ZTXTParser.

## Member Data Documentation

## ◆ m_impl

std::unique_ptr<PDBParserImpl> libebook::PDBParser::m_impl
| private

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

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

- PDBParser.h
- PDBParser.cpp