WPS4Parser Class Reference

#include <WPS4.h>

Inheritance diagram for WPS4Parser:
WPSParser

List of all members.

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< WPSFODm_CHFODs
std::vector< WPSFODm_PAFODs
shared_ptr< WPS4ContentListenerm_listener
std::map< uint8_t,
WPS4ParserInternal::Font
m_fonts
const uint8_t m_worksVersion

Constructor & Destructor Documentation

This class parses Works version 2 through 4.


Member Function Documentation

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]
Parameters:
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().


Member Data Documentation

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

uint32_t WPS4Parser::m_offset_eot [private]

Referenced by parse(), and readFODPage().

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


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