libwps::MultiplanParser Class Referencefinal

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

#include <Multiplan.h>

Inheritance diagram for libwps::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
 ~MultiplanParser () override
 destructor
void parse (librevenge::RVNGSpreadsheetInterface *documentInterface) final
 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 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
int version () const
 return the file version
libwps_tools_win::Font::Type getDefaultFontType () const
 returns the default font type, ie.
bool sendSpreadsheet ()
 try to send the main spreadsheet
bool sendCell (Vec2i const &cellPos, int pos)
 try to send a cell
bool readZones ()
 finds the different zones (spreadsheet, chart, print, ...)
bool readColumnsWidth ()
 read the columns width
bool readZonesList ()
 read the spreadsheet zone list
bool readZonesListV2 ()
 read the spreadsheet zone list v2
bool readCellDataPosition (WPSEntry const &entry)
 read the cell data position
bool readLink (int pos, WKSContentListener::FormulaInstruction &instruction)
 read a link
bool readFilename (int pos, librevenge::RVNGString &filename)
 read a link filename
bool readSharedData (int pos, int cellType, Vec2i const &cellPos, WKSContentListener::CellContent &content)
 read a shared data
bool readName (int pos, WKSContentListener::FormulaInstruction &instruction)
 reads a name and returns the cell's instruction
bool readFunctionNamesList ()
 try to read the function names: v2
bool checkPassword (char const *password) const
 check if the password corresponds to a ket
RVNGInputStreamPtr decodeStream (RVNGInputStreamPtr input)
 try to decode a stream, if successful, replace the stream'input by the new one
bool retrievePasswordKeys ()
 try to guess a password supposing that the Zone0 content is default
bool readZoneB ()
 read an unknown zone
bool readDouble (double &value)
 try to read a double value
bool readFormula (Vec2i const &cellPos, std::vector< WKSContentListener::FormulaInstruction > &formula, long endPos, std::string &extra)
 try to read a formula
bool readFormulaV2 (Vec2i const &cellPos, std::vector< WKSContentListener::FormulaInstruction > &formula, long endPos, std::string &extra)
 try to read a formula V2
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

Static Protected Member Functions

static std::shared_ptr< WKSContentListenercreateListener (librevenge::RVNGSpreadsheetInterface *interface)
 creates the main listener

Protected Attributes

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

Detailed Description

This class parses Microsoft Multiplan DOS spreadsheet v1.

Constructor & Destructor Documentation

◆ MultiplanParser()

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

constructor

◆ ~MultiplanParser()

libwps::MultiplanParser::~MultiplanParser ( )
override

destructor

Member Function Documentation

◆ checkFilePosition()

bool libwps::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 libwps::MultiplanParser::checkHeader ( WPSHeader * header,
bool strict = false )

checks if the document header is correct (or not)

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

◆ checkPassword()

bool libwps::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 > libwps::MultiplanParser::createListener ( librevenge::RVNGSpreadsheetInterface * interface)
staticprotected

creates the main listener

Referenced by parse().

◆ decodeStream()

RVNGInputStreamPtr libwps::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 libwps::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 libwps::MultiplanParser::parse ( librevenge::RVNGSpreadsheetInterface * documentInterface)
finalvirtual

called by WPSDocument to parse the file

Implements WKSParser.

◆ readCellDataPosition()

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

read the cell data position

Referenced by readZonesList().

◆ readColumnsWidth()

bool libwps::MultiplanParser::readColumnsWidth ( )
protected

read the columns width

Referenced by readZones().

◆ readDouble()

bool libwps::MultiplanParser::readDouble ( double & value)
protected

try to read a double value

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

◆ readFilename()

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

read a link filename

Referenced by readLink().

◆ readFormula()

bool libwps::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 libwps::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 libwps::MultiplanParser::readFunctionNamesList ( )
protected

try to read the function names: v2

Referenced by readZones().

◆ readLink()

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

read a link

Referenced by readFormula(), and readFormulaV2().

◆ readName()

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

reads a name and returns the cell's instruction

Referenced by readFormula(), and readFormulaV2().

◆ readSharedData()

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

read a shared data

Referenced by sendCell().

◆ readZoneB()

bool libwps::MultiplanParser::readZoneB ( )
protected

read an unknown zone

Referenced by readZones().

◆ readZones()

bool libwps::MultiplanParser::readZones ( )
protected

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

Referenced by parse().

◆ readZonesList()

bool libwps::MultiplanParser::readZonesList ( )
protected

read the spreadsheet zone list

Referenced by readZones().

◆ readZonesListV2()

bool libwps::MultiplanParser::readZonesListV2 ( )
protected

read the spreadsheet zone list v2

Referenced by readZones().

◆ retrievePasswordKeys()

bool libwps::MultiplanParser::retrievePasswordKeys ( )
protected

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

Referenced by readZonesListV2().

◆ sendCell()

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

try to send a cell

Referenced by sendSpreadsheet().

◆ sendSpreadsheet()

bool libwps::MultiplanParser::sendSpreadsheet ( )
protected

try to send the main spreadsheet

Referenced by parse().

◆ version()

int libwps::MultiplanParser::version ( ) const
protected

Member Data Documentation

◆ m_listener

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

◆ m_state


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

Generated on Sat Jul 19 2025 05:24:41 for libwps by doxygen 1.14.0