PocketWordParser Class Reference

This class parses some Pocket Word. More...

#include <PocketWord.h>

Inheritance diagram for PocketWordParser:
WPSParser

Public Member Functions

 PocketWordParser (RVNGInputStreamPtr &input, WPSHeaderPtr &header, libwps_tools_win::Font::Type encoding=libwps_tools_win::Font::UNKNOWN)
 constructor More...
 
 ~PocketWordParser () override
 destructor More...
 
void parse (librevenge::RVNGTextInterface *documentInterface) override
 called by WPSDocument to parse the file More...
 
bool checkHeader (WPSHeader *header, bool strict=false)
 checks if the document header is correct (or not) More...
 
- Public Member Functions inherited from WPSParser
 WPSParser (RVNGInputStreamPtr &input, WPSHeaderPtr &header)
 
virtual ~WPSParser ()
 

Protected Member Functions

bool createZones ()
 try to read the different zones More...
 
bool readFontNames (WPSEntry const &entry)
 try to read the font names More...
 
bool readPageDims (WPSEntry const &entry)
 try to read the page dimension More...
 
bool readParagraphList (WPSEntry const &entry, std::vector< int > &paraId)
 try to read a paragraph list More...
 
bool readParagraphDims (WPSEntry const &entry)
 try to read a paragraph dimensions' zone which follows the paragraph zone More...
 
bool readParagraphUnkn (WPSEntry const &entry)
 try to read a paragraph unknown zone: tabs, link? More...
 
bool readSound (WPSEntry const &entry, WPSEmbeddedObject &object)
 try to read a sound definition (maybe a picture) More...
 
bool readSoundData (WPSEntry const &entry, long pictSize, WPSEmbeddedObject &object)
 try to read a sound data (maybe a picture) More...
 
bool readUnkn8 (WPSEntry const &entry)
 try to read the unknown zone 8: one by file, maybe prefs More...
 
bool readUnkn2021 (WPSEntry const &entry, int type)
 try to read the unknown zone 20 and 21: one by file, find always no data, maybe style More...
 
bool checkFilePosition (long pos) const
 check if the file position is correct or not More...
 
void checkUnparsed ()
 try to parse the unparsed zones More...
 
void sendData ()
 try to send all the data More...
 
bool sendParagraph (size_t paraId)
 try to read and send a paragraph More...
 
- Protected Member Functions inherited from WPSParser
RVNGInputStreamPtrgetInput ()
 
RVNGInputStreamPtr getFileInput ()
 
WPSHeaderPtrgetHeader ()
 
int version () const
 
void setVersion (int vers)
 
libwps::DebugFileascii ()
 a DebugFile used to write what we recognize when we parse the document More...
 
NameMultiMapgetNameEntryMap ()
 
NameMultiMap const & getNameEntryMap () const
 

Protected Attributes

std::shared_ptr< WPSContentListenerm_listener
 the listener (if set) More...
 
std::shared_ptr< PocketWordParserInternal::Statem_state
 the main state More...
 

Private Member Functions

 PocketWordParser (const PocketWordParser &)=delete
 
PocketWordParseroperator= (const PocketWordParser &)=delete
 
std::shared_ptr< WPSContentListenercreateListener (librevenge::RVNGTextInterface *interface)
 creates the main listener More...
 

Friends

class PocketWordParserInternal::SubDocument
 

Additional Inherited Members

- Public Types inherited from WPSParser
typedef std::multimap< std::string, WPSEntryNameMultiMap
 a map to retrieve a file entry by name More...
 

Detailed Description

This class parses some Pocket Word.

Constructor & Destructor Documentation

◆ PocketWordParser() [1/2]

PocketWordParser::PocketWordParser ( RVNGInputStreamPtr input,
WPSHeaderPtr header,
libwps_tools_win::Font::Type  encoding = libwps_tools_win::Font::UNKNOWN 
)

constructor

◆ ~PocketWordParser()

PocketWordParser::~PocketWordParser ( )
override

destructor

◆ PocketWordParser() [2/2]

PocketWordParser::PocketWordParser ( const PocketWordParser )
privatedelete

Member Function Documentation

◆ checkFilePosition()

bool PocketWordParser::checkFilePosition ( long  pos) const
protected

check if the file position is correct or not

Referenced by checkHeader(), and createZones().

◆ checkHeader()

bool PocketWordParser::checkHeader ( WPSHeader header,
bool  strict = false 
)

checks if the document header is correct (or not)

Referenced by libwps::WPSDocument::isFileFormatSupported(), and parse().

◆ checkUnparsed()

void PocketWordParser::checkUnparsed ( )
protected

try to parse the unparsed zones

Referenced by parse().

◆ createListener()

std::shared_ptr< WPSContentListener > PocketWordParser::createListener ( librevenge::RVNGTextInterface *  interface)
private

creates the main listener

Referenced by parse().

◆ createZones()

bool PocketWordParser::createZones ( )
protected

try to read the different zones

Referenced by parse().

◆ operator=()

PocketWordParser& PocketWordParser::operator= ( const PocketWordParser )
privatedelete

◆ parse()

void PocketWordParser::parse ( librevenge::RVNGTextInterface *  documentInterface)
overridevirtual

called by WPSDocument to parse the file

Implements WPSParser.

◆ readFontNames()

bool PocketWordParser::readFontNames ( WPSEntry const &  entry)
protected

try to read the font names

Referenced by checkUnparsed(), and sendData().

◆ readPageDims()

bool PocketWordParser::readPageDims ( WPSEntry const &  entry)
protected

try to read the page dimension

Referenced by checkUnparsed(), and createListener().

◆ readParagraphDims()

bool PocketWordParser::readParagraphDims ( WPSEntry const &  entry)
protected

try to read a paragraph dimensions' zone which follows the paragraph zone

Referenced by checkUnparsed().

◆ readParagraphList()

bool PocketWordParser::readParagraphList ( WPSEntry const &  entry,
std::vector< int > &  paraId 
)
protected

try to read a paragraph list

Referenced by checkUnparsed(), and sendData().

◆ readParagraphUnkn()

bool PocketWordParser::readParagraphUnkn ( WPSEntry const &  entry)
protected

try to read a paragraph unknown zone: tabs, link?

Referenced by checkUnparsed().

◆ readSound()

bool PocketWordParser::readSound ( WPSEntry const &  entry,
WPSEmbeddedObject object 
)
protected

try to read a sound definition (maybe a picture)

Referenced by checkUnparsed(), and sendParagraph().

◆ readSoundData()

bool PocketWordParser::readSoundData ( WPSEntry const &  entry,
long  pictSize,
WPSEmbeddedObject object 
)
protected

try to read a sound data (maybe a picture)

Referenced by readSound().

◆ readUnkn2021()

bool PocketWordParser::readUnkn2021 ( WPSEntry const &  entry,
int  type 
)
protected

try to read the unknown zone 20 and 21: one by file, find always no data, maybe style

Referenced by checkUnparsed().

◆ readUnkn8()

bool PocketWordParser::readUnkn8 ( WPSEntry const &  entry)
protected

try to read the unknown zone 8: one by file, maybe prefs

Referenced by checkUnparsed().

◆ sendData()

void PocketWordParser::sendData ( )
protected

try to send all the data

Referenced by parse().

◆ sendParagraph()

bool PocketWordParser::sendParagraph ( size_t  paraId)
protected

try to read and send a paragraph

Referenced by checkUnparsed(), and sendData().

Friends And Related Function Documentation

◆ PocketWordParserInternal::SubDocument

friend class PocketWordParserInternal::SubDocument
friend

Member Data Documentation

◆ m_listener

std::shared_ptr<WPSContentListener> PocketWordParser::m_listener
protected

the listener (if set)

Referenced by checkUnparsed(), parse(), sendData(), and sendParagraph().

◆ m_state


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

Generated on Thu Jan 20 2022 00:00:00 for libwps by doxygen 1.9.1