XYWriteParser Class Reference documentation

Public Member Functions | Protected Member Functions | Protected Attributes | Private Member Functions | Friends | List of all members
XYWriteParser Class Reference

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

`#include <XYWrite.h>`

Inheritance diagram for XYWriteParser:

## 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
RVNGInputStreamPtr & | getInput ()
RVNGInputStreamPtr | getFileInput ()
WPSHeaderPtr & | getHeader ()
int | version () const
void | setVersion (int vers)
libwps::DebugFile & | ascii ()
| a DebugFile used to write what we recognize when we parse the document
NameMultiMap & | getNameEntryMap ()
NameMultiMap const & | getNameEntryMap () const

## Protected Attributes
std::shared_ptr< WPSContentListener > | m_listener
| the listener (if set)
std::shared_ptr< XYWriteParserInternal::State > | m_state
| the main state

## Private Member Functions
| XYWriteParser (const XYWriteParser &)=delete
XYWriteParser & | operator= (const XYWriteParser &)=delete
std::shared_ptr< WPSContentListener > | createListener (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, WPSEntry > | NameMultiMap
| 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

Referenced by checkFilePosition(), operator=(), update(), and XYWriteParser().

## ◆ ~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().

## ◆ 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

friend struct XYWriteParserInternal::Cell
| friend

## ◆ XYWriteParserInternal::SubDocument

friend class XYWriteParserInternal::SubDocument
| friend

## Member Data Documentation

## ◆ m_listener

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

the listener (if set)

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

## ◆ m_state

std::shared_ptr<XYWriteParserInternal::State> XYWriteParser::m_state
| protected

the main state

Referenced by checkFilePosition(), checkHeader(), createFormatChildren(), createListener(), createTable(), findAllZones(), parse(), parseFormat(), parseFrameZone(), parseMetaData(), parsePictureZone(), parseTextZone(), update(), and XYWriteParser().

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

- XYWrite.h
- XYWrite.cpp