WPS8Parser Class Reference

#include <WPS8.h>

Inheritance diagram for WPS8Parser:
WPSParser

List of all members.

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)

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.
void readNote (WPXInputStreamPtr &input, bool is_endnote)
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)
 Process a character property change.
void propertyChangePara (std::string rgchProp)

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

Member Typedef Documentation

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

Constructor & Destructor Documentation


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

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 
) [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::readNote ( WPXInputStreamPtr input,
bool  is_endnote 
) [private]

Referenced by readTextRange().

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


Member Data Documentation

Referenced by parse(), and readNote().

Referenced by parse(), and readNote().

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

Referenced by parse(), and readTextRange().

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

Referenced by parse(), and readNote().

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

Referenced by propertyChange(), and readFontsTable().

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

Referenced by parse(), and readNote().

uint32_t WPS8Parser::m_offset_eot [private]

Referenced by parse(), and readFODPage().

Referenced by propertyChangeDelta().

std::vector<WPSFOD> WPS8Parser::m_PAFODs [private]

Referenced by parse(), and readTextRange().

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

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


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