The class which parses text zones in a pc MS Works document v1-4. More...
#include <WPS4Text.h>
Public Member Functions | |
| WPS4Text (WPS4Parser &parser, WPXInputStreamPtr &input) | |
| contructor | |
| ~WPS4Text () | |
| destructor | |
| void | setListener (WPS4ContentListenerPtr &listen) |
| sets the listener | |
| int | numPages () const |
| returns the number of pages | |
| void | flushExtra () |
| sends the data which have not yet been sent to the listener | |
Protected Types | |
| typedef bool(WPS4Text::* | FDPParser )(long endPos, int &id, std::string &mess) |
| callback when a new attribute is found in an FDPP/FDPC entry | |
| typedef bool(WPS4Text::* | DataParser )(long bot, long eot, int id, long endPos, std::string &mess) |
| definition of the plc data parser (low level) | |
Protected Member Functions | |
| WPSEntry | getHeaderEntry () const |
| returns the header entry (if such entry exists, if not returns an invalid entry) | |
| WPSEntry | getFooterEntry () const |
| returns the footer entry (if such entry exists, if not returns an invalid entry) | |
| WPSEntry | getMainTextEntry () const |
| returns the main text entry (if such entry exists, if not returns an invalid entry) | |
| WPSEntry | getAllTextEntry () const |
| returns the text position | |
| bool | readText (WPSEntry const &entry) |
| reads a text section and sends it to a listener | |
| bool | readEntries () |
| finds all text entries (TEXT, SHdr, SFtr, BTEC, BTEP, FTNp, FTNp, BKMK, FONT, CHRT) | |
| bool | readStructures () |
| parsed all the text entries | |
| bool | findFDPStructures (int which) |
| finds the FDPC/FDPP structure using the BTEC/BTEP entries | |
| bool | findFDPStructuresByHand (int which) |
| finds the FDPC/FDPP structure by searching after the text zone | |
| bool | readFDP (WPSEntry const &entry, std::vector< WPS4TextInternal::DataFOD > &fods, FDPParser parser) |
| parses a FDPP or a FDPC entry (which contains a list of ATTR_TEXT/ATTR_PARAG with their definition ) and adds found data in listFODs | |
| bool | readPLC (WPSEntry const &zone, std::vector< long > &textPtrs, std::vector< long > &listValues, DataParser parser=0L) |
| reads a PLC (Pointer List Composant ?) in zone entry | |
| bool | defDataParser (long bot, long eot, int id, long endPos, std::string &mess) |
| default plc reader | |
| bool | readFontNames (WPSEntry const &entry) |
| reads the font names | |
| bool | readFont (long endPos, int &id, std::string &mess) |
| reads a font properties | |
| void | setProperty (WPS4TextInternal::Font const &font) |
| sends a font to the listener | |
| bool | readParagraph (long endPos, int &id, std::string &mess) |
| reads a paragraph properties | |
| void | setProperty (WPS4TextInternal::Paragraph const ¶) |
| sends a paragraph properties to the listener | |
| bool | readDosLink (WPSEntry const &entry) |
| reads the ZZDLink ( a list of filename ) | |
| bool | objectDataParser (long bot, long eot, int id, long endPos, std::string &mess) |
| reads a object properties ( position in text, size and definition in file) | |
| bool | readFootNotes (WPSEntry const &ftnD, WPSEntry const &ftnP) |
| reads the footnotes positions and definitions ( zones FTNd and FTNp) | |
| bool | footNotesDataParser (long bot, long eot, int id, long endPos, std::string &mess) |
| reads a book mark property ( string) | |
| bool | bkmkDataParser (long bot, long eot, int id, long endPos, std::string &mess) |
| reads a book mark property ( string) | |
| bool | dttmDataParser (long bot, long eot, int id, long endPos, std::string &mess) |
| reads a date time property | |
| int | version () const |
| returns the file version : 1-4 | |
| libwps::DebugFile & | ascii () |
| returns the debug file | |
Protected Attributes | |
| WPXInputStreamPtr | m_input |
| the main input | |
| WPS4Parser & | m_mainParser |
| the main parser | |
| WPS4ContentListenerPtr | m_listener |
| the listener | |
| shared_ptr < WPS4TextInternal::State > | m_state |
| the internal state | |
| libwps::DebugFile & | m_asciiFile |
| the ascii file | |
Friends | |
| class | WPS4Parser |
The class which parses text zones in a pc MS Works document v1-4.
This class must be associated with a WPS4Parser. It finds and reads:
|
protected |
definition of the plc data parser (low level)
| input | the file's input |
| endPos | the end of the properties' definition, |
| bot,\param | eot defined the text zone corresponding to these properties |
| id | the number of this properties |
| mess | a string which can be filled to indicate unparsed data |
|
protected |
callback when a new attribute is found in an FDPP/FDPC entry
| WPS4Text::WPS4Text | ( | WPS4Parser & | parser, |
| WPXInputStreamPtr & | input | ||
| ) |
contructor
| WPS4Text::~WPS4Text | ( | ) |
destructor
|
inlineprotected |
returns the debug file
Referenced by readDosLink(), readEntries(), readFDP(), readFontNames(), and readText().
|
protected |
reads a book mark property ( string)
Referenced by readStructures().
|
protected |
default plc reader
Referenced by readPLC().
|
protected |
reads a date time property
Referenced by readStructures().
|
protected |
finds the FDPC/FDPP structure using the BTEC/BTEP entries
| which | == 0 means FDPP |
Referenced by readStructures().
|
protected |
finds the FDPC/FDPP structure by searching after the text zone
| which | == 0 means FDPP |
Referenced by readStructures().
| void WPS4Text::flushExtra | ( | ) |
sends the data which have not yet been sent to the listener
|
protected |
reads a book mark property ( string)
Referenced by readFootNotes().
|
protected |
returns the text position
|
protected |
returns the footer entry (if such entry exists, if not returns an invalid entry)
|
protected |
returns the header entry (if such entry exists, if not returns an invalid entry)
|
protected |
returns the main text entry (if such entry exists, if not returns an invalid entry)
| int WPS4Text::numPages | ( | ) | const |
returns the number of pages
|
protected |
reads a object properties ( position in text, size and definition in file)
Referenced by readStructures().
|
protected |
reads the ZZDLink ( a list of filename )
Referenced by readStructures().
|
protected |
finds all text entries (TEXT, SHdr, SFtr, BTEC, BTEP, FTNp, FTNp, BKMK, FONT, CHRT)
|
protected |
parses a FDPP or a FDPC entry (which contains a list of ATTR_TEXT/ATTR_PARAG with their definition ) and adds found data in listFODs
this data are stored similarly in Mac v4 and all PC version
Referenced by readStructures().
|
protected |
reads a font properties
Referenced by readStructures().
|
protected |
reads the font names
Referenced by readStructures().
reads the footnotes positions and definitions ( zones FTNd and FTNp)
Referenced by readStructures().
|
protected |
reads a paragraph properties
Referenced by readStructures().
|
protected |
reads a PLC (Pointer List Composant ?) in zone entry
| zone | the zone of the data in the file, |
| textPtrs | lists of offset in text zones where properties changes |
| listValues | lists of properties values (filled only if values are simple types: int, ..) |
| parser | the parser to use to read the values |
Referenced by findFDPStructures(), readFootNotes(), and readStructures().
|
protected |
parsed all the text entries
|
protected |
reads a text section and sends it to a listener
Referenced by flushExtra().
|
inline |
sets the listener
|
protected |
sends a font to the listener
| font | the font's properties |
Referenced by flushExtra(), and readText().
|
protected |
sends a paragraph properties to the listener
| para | the paragraph's properties |
|
protected |
returns the file version : 1-4
Referenced by flushExtra(), footNotesDataParser(), readFDP(), readFont(), readFontNames(), readParagraph(), and readText().
|
friend |
|
protected |
the ascii file
Referenced by ascii().
|
protected |
the main input
Referenced by bkmkDataParser(), defDataParser(), dttmDataParser(), findFDPStructuresByHand(), footNotesDataParser(), numPages(), objectDataParser(), readDosLink(), readEntries(), readFDP(), readFont(), readFontNames(), readParagraph(), and readText().
|
protected |
the listener
Referenced by flushExtra(), readText(), setListener(), and setProperty().
|
protected |
the main parser
Referenced by findFDPStructures(), getFooterEntry(), getHeaderEntry(), objectDataParser(), readEntries(), readFont(), readParagraph(), readStructures(), readText(), and version().
|
mutableprotected |
the internal state
Referenced by bkmkDataParser(), dttmDataParser(), findFDPStructures(), findFDPStructuresByHand(), flushExtra(), footNotesDataParser(), getAllTextEntry(), getFooterEntry(), getHeaderEntry(), getMainTextEntry(), numPages(), objectDataParser(), readDosLink(), readEntries(), readFDP(), readFont(), readFontNames(), readFootNotes(), readParagraph(), readStructures(), readText(), version(), and WPS4Text().