libebook::PDXParser Class Reference

#include <PDXParser.h>

Inheritance diagram for libebook::PDXParser:
libebook::PDBParser libebook::PLKRParser libebook::PMLParser libebook::TDParser libebook::ZTXTParser

List of all members.

Public Member Functions

virtual ~PDXParser ()=0
bool isSupported ()
 Test whether the input document is in supported format.
bool parse ()
 Parse input and produce output to document.

Protected Member Functions

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

Private Member Functions

 PDXParser (const PDXParser &other)
PDXParseroperator= (const PDXParser &other)
virtual bool isFormatSupported (unsigned type, unsigned creator)=0
 Check whether a specific subformat is supported.
virtual void readAppInfoRecord (WPXInputStream *record)=0
virtual void readSortInfoRecord (WPXInputStream *record)=0
virtual void readIndexRecord (WPXInputStream *record)=0
virtual void readDataRecord (WPXInputStream *record, bool last=false)=0
virtual void readDataRecords ()
void readHeader ()
WPXInputStream * getRecordStream (unsigned n) const

Private Attributes

boost::scoped_ptr< PDXParserImplm_impl

Constructor & Destructor Documentation

libebook::PDXParser::PDXParser ( const PDXParser other) [private]
libebook::PDXParser::~PDXParser ( ) [pure virtual]
libebook::PDXParser::PDXParser ( WPXInputStream *  input,
WPXDocumentInterface *  document 
) [protected]

Instantiate a parser for a document in Palm Database Format.

  • [in] input input stream
  • [in] document output document generator

Member Function Documentation

WPXInputStream * 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
WPXInputStream * 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().

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().

WPXInputStream * 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().

WPXInputStream * 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
WPXInputStream * 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::PMLParser::isFormatSupported(), and libebook::PLKRParser::isFormatSupported().

WPXInputStream * libebook::PDXParser::getRecordStream ( unsigned  n) const [private]
virtual bool libebook::PDXParser::isFormatSupported ( unsigned  type,
unsigned  creator 
) [private, pure virtual]

Check whether a specific subformat is supported.

  • [in] type the subformat's type
  • [in] creator the document's creator app.
Returns:
true if the subformat is supported

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

Referenced by isSupported().

Test whether the input document is in supported format.

This function will typically only read the Palm Database Format header, but it might read the info block too.

Returns:
true if the document is supported
PDXParser& libebook::PDXParser::operator= ( const PDXParser other) [private]

Parse input and produce output to document.

Returns:
true if the input has been parsed successfully.
virtual void libebook::PDXParser::readAppInfoRecord ( WPXInputStream *  record) [private, pure virtual]
virtual void libebook::PDXParser::readDataRecord ( WPXInputStream *  record,
bool  last = false 
) [private, pure virtual]
void libebook::PDXParser::readDataRecords ( ) [private, virtual]

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

Referenced by parse().

void libebook::PDXParser::readHeader ( ) [private]

Referenced by isSupported(), and parse().

virtual void libebook::PDXParser::readIndexRecord ( WPXInputStream *  record) [private, pure virtual]
virtual void libebook::PDXParser::readSortInfoRecord ( WPXInputStream *  record) [private, pure virtual]

Member Data Documentation


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