WPS8Parser Class Reference

#include <WPS8.h>

Inheritance diagram for WPS8Parser:
WPSParser

Classes

struct  Note
struct  Stream
struct  Zone
 Starting near beginning of CONTENTS stream, there is an index to various types of pages in the document. More...

Public Member Functions

 WPS8Parser (WPXInputStreamPtr &input, WPSHeaderPtr &header)
 ~WPS8Parser ()
void parse (WPXDocumentInterface *documentInterface)
- Public Member Functions inherited from WPSParser
 WPSParser (WPXInputStreamPtr &input, WPSHeaderPtr &header)
virtual ~WPSParser ()

Protected Types

typedef std::multimap
< std::string, Zone
IndexMultiMap

Private Member Functions

void readFontsTable (WPXInputStreamPtr &input)
 Reads fonts table into memory.
void readStreams (WPXInputStreamPtr &input)
 Reads streams (subdocuments) information.
void readNotes (std::vector< Note > &dest, WPXInputStreamPtr &input, const char *key)
void appendUTF16LE (WPXInputStreamPtr &input)
void readTextRange (WPXInputStreamPtr &input, uint32_t startpos, uint32_t endpos, uint16_t stream)
 Read the range of the document text using previously-read formatting information, up to but excluding endpos.
bool readFODPage (WPXInputStreamPtr &input, std::vector< WPSFOD > &FODs, uint16_t page_size)
 Read a single page (of size page_size bytes) that contains formatting descriptors for either characters OR paragraphs.
void parseHeaderIndexEntry (WPXInputStreamPtr &input)
 Parse an index entry in the file format's header.
void parseHeaderIndex (WPXInputStreamPtr &input)
 In the header, parse the index to the different sections of the CONTENTS stream.
void parsePages (std::vector< WPSPageSpan > &pageList, WPXInputStreamPtr &input)
 Read the page format from the file.
void parse (WPXInputStreamPtr &stream)
void propertyChangeDelta (uint32_t newTextAttributeBits)
void propertyChange (std::string rgchProp, uint16_t &specialCode, int &fieldType)
 Process a character property change.
void propertyChangePara (std::string rgchProp)
void sendNote (WPXInputStreamPtr &input, int noteId, bool is_endnote)

Private Attributes

shared_ptr< WPS8ContentListenerm_listener
 the listener
uint32_t m_offset_eot
uint32_t m_oldTextAttributeBits
IndexMultiMap m_headerIndexTable
std::vector< WPSFODm_CHFODs
std::vector< WPSFODm_PAFODs
std::vector< std::string > m_fontNames
std::vector< Streamm_streams
std::vector< Notem_footnotes
int m_actualFootnote
std::vector< Notem_endnotes
int m_actualEndnote

Friends

class WPS8ParserInternal::SubDocument

Additional Inherited Members

- Protected Member Functions inherited from WPSParser
WPSHeaderPtrgetHeader ()
WPXInputStreamPtrgetInput ()

Member Typedef Documentation

typedef std::multimap<std::string, Zone> WPS8Parser::IndexMultiMap
protected

Constructor & Destructor Documentation

WPS8Parser::WPS8Parser ( WPXInputStreamPtr input,
WPSHeaderPtr header 
)
WPS8Parser::~WPS8Parser ( )

Member Function Documentation

void WPS8Parser::appendUTF16LE ( WPXInputStreamPtr input)
private

Referenced by readTextRange().

void WPS8Parser::parse ( WPXDocumentInterface *  documentInterface)
virtual

Implements WPSParser.

void WPS8Parser::parse ( WPXInputStreamPtr stream)
private
void WPS8Parser::parseHeaderIndex ( WPXInputStreamPtr input)
private

In the header, parse the index to the different sections of the CONTENTS stream.

Referenced by parse().

void WPS8Parser::parseHeaderIndexEntry ( WPXInputStreamPtr input)
private

Parse an index entry in the file format's header.

For example, this function may be called multiple times to parse several FDPP entries. This functions begins at the current position of the input stream, which will be advanced.

Referenced by parseHeaderIndex().

void WPS8Parser::parsePages ( std::vector< WPSPageSpan > &  pageList,
WPXInputStreamPtr input 
)
private

Read the page format from the file.

It seems that WPS8 files can only have one page format throughout the whole document.

Referenced by parse().

void WPS8Parser::propertyChange ( std::string  rgchProp,
uint16_t &  specialCode,
int &  fieldType 
)
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 8, the position in rgchProp is not significant because there are some kind of codes.

Referenced by readTextRange().

void WPS8Parser::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 WPS8Parser::propertyChangePara ( std::string  rgchProp)
private

Referenced by readTextRange().

bool WPS8Parser::readFODPage ( WPXInputStreamPtr input,
std::vector< WPSFOD > &  FODs,
uint16_t  page_size 
)
private

Read a single page (of size page_size bytes) that contains formatting descriptors 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 WPS8Parser::readFontsTable ( WPXInputStreamPtr input)
private

Reads fonts table into memory.

Referenced by parse().

void WPS8Parser::readNotes ( std::vector< Note > &  dest,
WPXInputStreamPtr input,
const char *  key 
)
private

Referenced by parse().

void WPS8Parser::readStreams ( WPXInputStreamPtr input)
private

Reads streams (subdocuments) information.

Referenced by parse().

void WPS8Parser::readTextRange ( WPXInputStreamPtr input,
uint32_t  startpos,
uint32_t  endpos,
uint16_t  stream 
)
private

Read the range of the document text using previously-read formatting information, up to but excluding endpos.

Referenced by parse(), and sendNote().

void WPS8Parser::sendNote ( WPXInputStreamPtr input,
int  noteId,
bool  is_endnote 
)
private

Friends And Related Function Documentation

friend class WPS8ParserInternal::SubDocument
friend

Member Data Documentation

int WPS8Parser::m_actualEndnote
private

Referenced by parse(), and readTextRange().

int WPS8Parser::m_actualFootnote
private

Referenced by parse(), and readTextRange().

std::vector<WPSFOD> WPS8Parser::m_CHFODs
private

Referenced by parse(), and readTextRange().

std::vector<Note> WPS8Parser::m_endnotes
private

Referenced by parse(), and sendNote().

std::vector<std::string> WPS8Parser::m_fontNames
private

Referenced by propertyChange(), and readFontsTable().

std::vector<Note> WPS8Parser::m_footnotes
private

Referenced by parse(), and sendNote().

IndexMultiMap WPS8Parser::m_headerIndexTable
private
shared_ptr<WPS8ContentListener> WPS8Parser::m_listener
private
uint32_t WPS8Parser::m_offset_eot
private

Referenced by parse(), and readFODPage().

uint32_t WPS8Parser::m_oldTextAttributeBits
private
std::vector<WPSFOD> WPS8Parser::m_PAFODs
private

Referenced by parse(), and readTextRange().

std::vector<Stream> WPS8Parser::m_streams
private

Referenced by parse(), readStreams(), and sendNote().


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

Generated on Wed Aug 8 2012 16:07:58 for libwps by doxygen 1.8.1.2