MultiplanParser Class Referencefinal

This class parses Microsoft Multiplan DOS spreadsheet v1. More...

#include <Multiplan.h>

Inheritance diagram for MultiplanParser:
WKSParser

Public Member Functions

 MultiplanParser (RVNGInputStreamPtr &input, WPSHeaderPtr &header, libwps_tools_win::Font::Type encoding=libwps_tools_win::Font::UNKNOWN, char const *password=nullptr)
 constructor More...
 
 ~MultiplanParser () override
 destructor More...
 
void parse (librevenge::RVNGSpreadsheetInterface *documentInterface) final
 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 WKSParser
 WKSParser (RVNGInputStreamPtr &input, WPSHeaderPtr &header)
 
virtual ~WKSParser ()
 

Protected Member Functions

bool checkFilePosition (long pos)
 return true if the pos is in the file, update the file size if need More...
 
int version () const
 return the file version More...
 
libwps_tools_win::Font::Type getDefaultFontType () const
 returns the default font type, ie. More...
 
std::shared_ptr< WKSContentListenercreateListener (librevenge::RVNGSpreadsheetInterface *interface)
 creates the main listener More...
 
bool sendSpreadsheet ()
 try to send the main spreadsheet More...
 
bool sendCell (Vec2i const &cellPos, int pos)
 try to send a cell More...
 
bool readZones ()
 finds the different zones (spreadsheet, chart, print, ...) More...
 
bool readColumnsWidth ()
 read the columns width More...
 
bool readZonesList ()
 read the spreadsheet zone list More...
 
bool readZonesListV2 ()
 read the spreadsheet zone list v2 More...
 
bool readCellDataPosition (WPSEntry const &entry)
 read the cell data position More...
 
bool readLink (int pos, WKSContentListener::FormulaInstruction &instruction)
 read a link More...
 
bool readFilename (int pos, librevenge::RVNGString &filename)
 read a link filename More...
 
bool readSharedData (int pos, int cellType, Vec2i const &cellPos, WKSContentListener::CellContent &content)
 read a shared data More...
 
bool readName (int pos, WKSContentListener::FormulaInstruction &instruction)
 reads a name and returns the cell's instruction More...
 
bool readFunctionNamesList ()
 try to read the function names: v2 More...
 
bool checkPassword (char const *password) const
 check if the password corresponds to a ket More...
 
RVNGInputStreamPtr decodeStream (RVNGInputStreamPtr input)
 try to decode a stream, if successful, replace the stream'input by the new one More...
 
bool retrievePasswordKeys ()
 try to guess a password supposing that the Zone0 content is default More...
 
bool readZoneB ()
 read an unknown zone More...
 
bool readDouble (double &value)
 try to read a double value More...
 
bool readFormula (Vec2i const &cellPos, std::vector< WKSContentListener::FormulaInstruction > &formula, long endPos, std::string &extra)
 try to read a formula More...
 
bool readFormulaV2 (Vec2i const &cellPos, std::vector< WKSContentListener::FormulaInstruction > &formula, long endPos, std::string &extra)
 try to read a formula V2 More...
 
- Protected Member Functions inherited from WKSParser
RVNGInputStreamPtrgetInput ()
 
void resetInput (RVNGInputStreamPtr const &newInput)
 
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...
 

Protected Attributes

std::shared_ptr< WKSContentListenerm_listener
 
std::shared_ptr< MultiplanParserInternal::Statem_state
 the listener (if set) More...
 

Detailed Description

This class parses Microsoft Multiplan DOS spreadsheet v1.

Constructor & Destructor Documentation

◆ MultiplanParser()

MultiplanParser::MultiplanParser ( RVNGInputStreamPtr input,
WPSHeaderPtr header,
libwps_tools_win::Font::Type  encoding = libwps_tools_win::Font::UNKNOWN,
char const *  password = nullptr 
)

constructor

◆ ~MultiplanParser()

MultiplanParser::~MultiplanParser ( )
override

destructor

Member Function Documentation

◆ checkFilePosition()

bool MultiplanParser::checkFilePosition ( long  pos)
protected

return true if the pos is in the file, update the file size if need

Referenced by checkHeader(), decodeStream(), readColumnsWidth(), readDouble(), readFunctionNamesList(), readZoneB(), readZones(), readZonesList(), readZonesListV2(), and retrievePasswordKeys().

◆ checkHeader()

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

checks if the document header is correct (or not)

Referenced by parse().

◆ checkPassword()

bool MultiplanParser::checkPassword ( char const *  password) const
protected

check if the password corresponds to a ket

Referenced by readZonesListV2(), and retrievePasswordKeys().

◆ createListener()

std::shared_ptr< WKSContentListener > MultiplanParser::createListener ( librevenge::RVNGSpreadsheetInterface *  interface)
protected

creates the main listener

Referenced by parse().

◆ decodeStream()

RVNGInputStreamPtr MultiplanParser::decodeStream ( RVNGInputStreamPtr  input)
protected

try to decode a stream, if successful, replace the stream'input by the new one

Referenced by readZonesListV2().

◆ getDefaultFontType()

libwps_tools_win::Font::Type MultiplanParser::getDefaultFontType ( ) const
protected

returns the default font type, ie.

the encoding given by the constructor if given or the encoding deduiced from the version.

◆ parse()

void MultiplanParser::parse ( librevenge::RVNGSpreadsheetInterface *  documentInterface)
finalvirtual

called by WPSDocument to parse the file

Implements WKSParser.

◆ readCellDataPosition()

bool MultiplanParser::readCellDataPosition ( WPSEntry const &  entry)
protected

read the cell data position

Referenced by readZonesList().

◆ readColumnsWidth()

bool MultiplanParser::readColumnsWidth ( )
protected

read the columns width

Referenced by readZones().

◆ readDouble()

bool MultiplanParser::readDouble ( double &  value)
protected

try to read a double value

Referenced by readFormula(), readSharedData(), and sendCell().

◆ readFilename()

bool MultiplanParser::readFilename ( int  pos,
librevenge::RVNGString &  filename 
)
protected

read a link filename

Referenced by readLink().

◆ readFormula()

bool MultiplanParser::readFormula ( Vec2i const &  cellPos,
std::vector< WKSContentListener::FormulaInstruction > &  formula,
long  endPos,
std::string &  extra 
)
protected

try to read a formula

Referenced by readSharedData(), and sendCell().

◆ readFormulaV2()

bool MultiplanParser::readFormulaV2 ( Vec2i const &  cellPos,
std::vector< WKSContentListener::FormulaInstruction > &  formula,
long  endPos,
std::string &  extra 
)
protected

try to read a formula V2

Referenced by readSharedData(), and sendCell().

◆ readFunctionNamesList()

bool MultiplanParser::readFunctionNamesList ( )
protected

try to read the function names: v2

Referenced by readZones().

◆ readLink()

bool MultiplanParser::readLink ( int  pos,
WKSContentListener::FormulaInstruction instruction 
)
protected

read a link

Referenced by readFormula(), and readFormulaV2().

◆ readName()

bool MultiplanParser::readName ( int  pos,
WKSContentListener::FormulaInstruction instruction 
)
protected

reads a name and returns the cell's instruction

Referenced by readFormula(), and readFormulaV2().

◆ readSharedData()

bool MultiplanParser::readSharedData ( int  pos,
int  cellType,
Vec2i const &  cellPos,
WKSContentListener::CellContent content 
)
protected

read a shared data

Referenced by sendCell().

◆ readZoneB()

bool MultiplanParser::readZoneB ( )
protected

read an unknown zone

Referenced by readZones().

◆ readZones()

bool MultiplanParser::readZones ( )
protected

finds the different zones (spreadsheet, chart, print, ...)

Referenced by parse().

◆ readZonesList()

bool MultiplanParser::readZonesList ( )
protected

read the spreadsheet zone list

Referenced by readZones().

◆ readZonesListV2()

bool MultiplanParser::readZonesListV2 ( )
protected

read the spreadsheet zone list v2

Referenced by readZones().

◆ retrievePasswordKeys()

bool MultiplanParser::retrievePasswordKeys ( )
protected

try to guess a password supposing that the Zone0 content is default

Referenced by readZonesListV2().

◆ sendCell()

bool MultiplanParser::sendCell ( Vec2i const &  cellPos,
int  pos 
)
protected

try to send a cell

Referenced by sendSpreadsheet().

◆ sendSpreadsheet()

bool MultiplanParser::sendSpreadsheet ( )
protected

try to send the main spreadsheet

Referenced by parse().

◆ version()

int MultiplanParser::version ( ) const
protected

Member Data Documentation

◆ m_listener

std::shared_ptr<WKSContentListener> MultiplanParser::m_listener
protected

Referenced by parse(), sendCell(), and sendSpreadsheet().

◆ m_state


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

Generated on Fri May 27 2022 03:07:00 for libwps by doxygen 1.8.14