#include <WPS4.h>
Public Member Functions | |
WPS4Parser (WPXInputStreamPtr &input, WPSHeaderPtr &header) | |
This class parses Works version 2 through 4. | |
~WPS4Parser () | |
void | parse (WPXDocumentInterface *documentInterface) |
Private Member Functions | |
void | parsePages (std::vector< WPSPageSpan > &pageList, WPXInputStreamPtr &input) |
Read the page format from the file. | |
void | parse (WPXInputStreamPtr &input) |
void | readFontsTable (WPXInputStreamPtr &input) |
Reads fonts table into memory. | |
bool | readFODPage (WPXInputStreamPtr &input, std::vector< WPSFOD > &FODs) |
Read a single "page" (128 bytes) that contains formatting descriptors (FODs) for either characters OR paragraphs. | |
void | propertyChangeDelta (uint32_t newTextAttributeBits) |
void | propertyChange (std::string rgchProp, WPS4ParserInternal::Font &font) |
Process a character property change. | |
void | propertyChangePara (std::string rgchProp) |
void | readText (WPXInputStreamPtr &input) |
Read the text of the document using previously-read formatting information. | |
Private Attributes | |
uint32_t | m_oldTextAttributeBits |
uint32_t | m_offset_eot |
std::vector< WPSFOD > | m_CHFODs |
std::vector< WPSFOD > | m_PAFODs |
shared_ptr< WPS4ContentListener > | m_listener |
std::map< uint8_t, WPS4ParserInternal::Font > | m_fonts |
const uint8_t | m_worksVersion |
WPS4Parser::WPS4Parser | ( | WPXInputStreamPtr & | input, |
WPSHeaderPtr & | header | ||
) |
This class parses Works version 2 through 4.
void WPS4Parser::parse | ( | WPXDocumentInterface * | documentInterface | ) | [virtual] |
Implements WPSParser.
void WPS4Parser::parse | ( | WPXInputStreamPtr & | input | ) | [private] |
void WPS4Parser::parsePages | ( | std::vector< WPSPageSpan > & | pageList, |
WPXInputStreamPtr & | input | ||
) | [private] |
Read the page format from the file.
It seems that WPS4 files can only have one page format throughout the whole document.
Referenced by parse().
void WPS4Parser::propertyChange | ( | std::string | rgchProp, |
WPS4ParserInternal::Font & | font | ||
) | [private] |
Process a character property change.
The Works format supplies all the character formatting each time there is any change (as opposed to HTML, for example). In Works 4, the position in in rgchProp is significant (e.g., bold is always in the first byte).
Referenced by readText().
void WPS4Parser::propertyChangeDelta | ( | uint32_t | newTextAttributeBits | ) | [private] |
newTextAttributeBits,: | all the new, current bits (will be compared against old, and old will be discarded). |
Referenced by propertyChange().
void WPS4Parser::propertyChangePara | ( | std::string | rgchProp | ) | [private] |
Referenced by readText().
bool WPS4Parser::readFODPage | ( | WPXInputStreamPtr & | input, |
std::vector< WPSFOD > & | FODs | ||
) | [private] |
Read a single "page" (128 bytes) that contains formatting descriptors (FODs) for either characters OR paragraphs.
Starts reading at current position in stream.
Return: true if more pages of this type exist, otherwise false
Referenced by parse().
void WPS4Parser::readFontsTable | ( | WPXInputStreamPtr & | input | ) | [private] |
Reads fonts table into memory.
Referenced by parse().
void WPS4Parser::readText | ( | WPXInputStreamPtr & | input | ) | [private] |
Read the text of the document using previously-read formatting information.
Referenced by parse().
std::vector<WPSFOD> WPS4Parser::m_CHFODs [private] |
Referenced by parse(), and readText().
std::map<uint8_t, WPS4ParserInternal::Font> WPS4Parser::m_fonts [private] |
Referenced by propertyChange(), and readFontsTable().
shared_ptr<WPS4ContentListener> WPS4Parser::m_listener [private] |
Referenced by parse(), propertyChange(), propertyChangeDelta(), propertyChangePara(), and readText().
uint32_t WPS4Parser::m_offset_eot [private] |
Referenced by parse(), and readFODPage().
uint32_t WPS4Parser::m_oldTextAttributeBits [private] |
Referenced by propertyChangeDelta(), and readText().
std::vector<WPSFOD> WPS4Parser::m_PAFODs [private] |
Referenced by parse(), and readText().
const uint8_t WPS4Parser::m_worksVersion [private] |
Referenced by parse(), propertyChange(), and readText().