XYWriteParser Class Reference

This class parses XYWrite Dos and Win4 files. More...

#include <XYWrite.h>

Inheritance diagram for XYWriteParser:
WPSParser

Public Member Functions

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

Protected Member Functions

bool checkFilePosition (long pos) const
 check if the file position is correct or not
 
bool findAllZones ()
 tries to find the end of main zone, the meta data zones (only Win4)
 
bool parseTextZone (WPSEntry const &entry, std::string const &styleName="")
 tries to parse the main text zone
 
bool parseFrameZone (XYWriteParserInternal::Format const &frameFormat)
 tries to parse a frame
 
bool parsePictureZone (XYWriteParserInternal::Format const &pictureFormat)
 tries to parse a picture
 
bool parseMetaData (WPSEntry const &entry)
 tries to parse the meta data zone
 
bool parseFormat (XYWriteParserInternal::Format &format)
 tries to parse a format: first character 0xae is read
 
bool createFormatChildren (XYWriteParserInternal::Format &format, size_t fPos=2)
 tries to parse again a format to create a list of child: SS, FA, FM1, ...
 
bool update (XYWriteParserInternal::Format const &format, libwps_tools_win::Font::Type &fontType) const
 try to update the listener data(font,paragraph style, ...)
 
bool createTable (XYWriteParserInternal::Format const &format, long endPos)
 tries to create a table
 
- 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
 
NameMultiMapgetNameEntryMap ()
 
NameMultiMap constgetNameEntryMap () const
 

Protected Attributes

std::shared_ptr< WPSContentListenerm_listener
 the listener (if set)
 
std::shared_ptr< XYWriteParserInternal::Statem_state
 the main state
 

Private Member Functions

 XYWriteParser (const XYWriteParser &)=delete
 
XYWriteParseroperator= (const XYWriteParser &)=delete
 
std::shared_ptr< WPSContentListenercreateListener (librevenge::RVNGTextInterface *interface)
 creates the main listener
 

Friends

struct XYWriteParserInternal::Cell
 
class XYWriteParserInternal::SubDocument
 

Additional Inherited Members

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

Detailed Description

This class parses XYWrite Dos and Win4 files.

Constructor & Destructor Documentation

◆ XYWriteParser() [1/2]

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

constructor

◆ ~XYWriteParser()

XYWriteParser::~XYWriteParser ( )
override

destructor

◆ XYWriteParser() [2/2]

XYWriteParser::XYWriteParser ( const XYWriteParser & )
privatedelete

Member Function Documentation

◆ checkFilePosition()

bool XYWriteParser::checkFilePosition ( long pos) const
protected

check if the file position is correct or not

Referenced by checkHeader().

◆ checkHeader()

bool XYWriteParser::checkHeader ( WPSHeader * header,
bool strict = false )

checks if the document header is correct (or not)

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

◆ createFormatChildren()

bool XYWriteParser::createFormatChildren ( XYWriteParserInternal::Format & format,
size_t fPos = 2 )
protected

tries to parse again a format to create a list of child: SS, FA, FM1, ...

Referenced by parseTextZone().

◆ createListener()

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

creates the main listener

Referenced by parse().

◆ createTable()

bool XYWriteParser::createTable ( XYWriteParserInternal::Format const & format,
long endPos )
protected

tries to create a table

Referenced by parseTextZone().

◆ findAllZones()

bool XYWriteParser::findAllZones ( )
protected

tries to find the end of main zone, the meta data zones (only Win4)

Referenced by parse().

◆ operator=()

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

◆ parse()

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

called by WPSDocument to parse the file

Implements WPSParser.

◆ parseFormat()

bool XYWriteParser::parseFormat ( XYWriteParserInternal::Format & format)
protected

tries to parse a format: first character 0xae is read

Referenced by createListener(), createTable(), parseMetaData(), and parseTextZone().

◆ parseFrameZone()

bool XYWriteParser::parseFrameZone ( XYWriteParserInternal::Format const & frameFormat)
protected

tries to parse a frame

Referenced by parseTextZone().

◆ parseMetaData()

bool XYWriteParser::parseMetaData ( WPSEntry const & entry)
protected

tries to parse the meta data zone

Referenced by findAllZones().

◆ parsePictureZone()

bool XYWriteParser::parsePictureZone ( XYWriteParserInternal::Format const & pictureFormat)
protected

tries to parse a picture

Referenced by parseTextZone().

◆ parseTextZone()

bool XYWriteParser::parseTextZone ( WPSEntry const & entry,
std::string const & styleName = "" )
protected

tries to parse the main text zone

Referenced by parse(), and XYWriteParserInternal::Cell::sendContent().

◆ update()

bool XYWriteParser::update ( XYWriteParserInternal::Format const & format,
libwps_tools_win::Font::Type & fontType ) const
protected

try to update the listener data(font,paragraph style, ...)

Referenced by parseTextZone().

Friends And Related Symbol Documentation

◆ XYWriteParserInternal::Cell

◆ XYWriteParserInternal::SubDocument

Member Data Documentation

◆ m_listener

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

the listener (if set)

Referenced by createTable(), parse(), parseFrameZone(), parsePictureZone(), parseTextZone(), and update().

◆ m_state


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

Generated on Tue May 21 2024 12:30:44 for libwps by doxygen 1.10.0