Go to the documentation of this file.
27 #include <librevenge-stream/librevenge-stream.h>
40 namespace MultiplanParserInternal
55 char const *password=
nullptr);
59 void parse(librevenge::RVNGSpreadsheetInterface *documentInterface)
final;
74 static std::shared_ptr<WKSContentListener>
createListener(librevenge::RVNGSpreadsheetInterface *interface);
97 bool readFilename(
int pos, librevenge::RVNGString &filename);
124 bool readFormula(
Vec2i const &cellPos, std::vector<WKSContentListener::FormulaInstruction> &formula,
long endPos, std::string &extra);
126 bool readFormulaV2(
Vec2i const &cellPos, std::vector<WKSContentListener::FormulaInstruction> &formula,
long endPos, std::string &extra);
129 std::shared_ptr<MultiplanParserInternal::State>
m_state;
@ F_Text
Definition: WKSContentListener.h:59
@ SharedData
Definition: Multiplan.cpp:95
bool readFormulaV2(Vec2i const &cellPos, std::vector< WKSContentListener::FormulaInstruction > &formula, long endPos, std::string &extra)
try to read a formula V2
Definition: Multiplan.cpp:1399
const char * m_name
Definition: Multiplan.cpp:962
#define WPS_N_ELEMENTS(m)
Definition: libwps_internal.h:124
the state of MultiplanParser
Definition: Multiplan.cpp:128
std::shared_ptr< WKSContentListener > m_listener
Definition: Multiplan.h:128
int version() const
return the file version
Definition: Multiplan.cpp:233
@ WPS_MULTIPLAN
Definition: WPSDocument.h:58
long m_eof
the last file position
Definition: Multiplan.cpp:169
bool retrievePasswordKeys()
try to guess a password supposing that the Zone0 content is default
Definition: Multiplan.cpp:2791
This class parses Microsoft Multiplan DOS spreadsheet v1.
Definition: Multiplan.h:49
librevenge::RVNGString m_fileName
the file name (external reference)
Definition: WKSContentListener.h:96
std::vector< FormulaInstruction > m_formula
the formula list of instruction
Definition: WKSContentListener.h:155
static std::string str()
Definition: WPSDebug.h:200
static bool open(std::string const &)
Definition: WPSDebug.h:215
bool checkHeader(WPSHeader *header, bool strict=false)
checks if the document header is correct (or not)
Definition: Multiplan.cpp:317
@ C_FORMULA
Definition: WKSContentListener.h:102
static void addPos(long)
Definition: WPSDebug.h:220
@ F_Cell
Definition: WKSContentListener.h:59
std::map< int, WKSContentListener::FormulaInstruction > m_posToLinkMap
the list of link instruction
Definition: Multiplan.cpp:185
long end() const
returns the end offset
Definition: WPSEntry.h:78
bool readZonesListV2()
read the spreadsheet zone list v2
Definition: Multiplan.cpp:692
MultiplanParser(RVNGInputStreamPtr &input, WPSHeaderPtr &header, libwps_tools_win::Font::Type encoding=libwps_tools_win::Font::UNKNOWN, char const *password=nullptr)
constructor
Definition: Multiplan.cpp:221
void setLength(long l)
sets the zone size
Definition: WPSEntry.h:62
bool readZoneB()
read an unknown zone
Definition: Multiplan.cpp:2237
static const Functions s_listOperatorsV2[]
Definition: Multiplan.cpp:1355
std::vector< WPSColumnFormat > getColumnsWidth() const
returns the column width in point
Definition: Multiplan.cpp:204
std::vector< Zone > m_zonesList
the list of cell's data zone
Definition: Multiplan.cpp:179
WPSEntry m_entry
the zone data
Definition: Multiplan.cpp:123
RVNGInputStreamPtr decodeStream(RVNGInputStreamPtr input)
try to decode a stream, if successful, replace the stream'input by the new one
Definition: Multiplan.cpp:2840
Definition: libwps_internal.cpp:38
@ F_Operator
Definition: WKSContentListener.h:59
bool readCellDataPosition(WPSEntry const &entry)
read the cell data position
Definition: Multiplan.cpp:1827
@ F_Double
Definition: WKSContentListener.h:59
bool send(WPSListenerPtr &) final
call when a cell must be send
Definition: Multiplan.cpp:86
@ F_Function
Definition: WKSContentListener.h:59
static void reset()
Definition: WPSDebug.h:224
void resetInput(RVNGInputStreamPtr const &newInput)
Definition: WKSParser.h:45
~MultiplanParser() override
destructor
Definition: Multiplan.cpp:229
double m_doubleValue
value ( if type==F_Double )
Definition: WKSContentListener.h:83
Zone()
constructor
Definition: Multiplan.cpp:99
define the font properties
Definition: WPSFont.h:36
bool sendCell(Vec2i const &cellPos, int pos)
try to send a cell
Definition: Multiplan.cpp:2306
bool valid(bool checkId=false) const
returns true if the zone length is positive
Definition: WPSEntry.h:89
bool checkPassword(char const *password) const
check if the password corresponds to a ket
Definition: Multiplan.cpp:2707
static const char * s_listFunctions[]
Definition: Multiplan.cpp:1020
basic class to store an entry in a file This contained :
Definition: WPSEntry.h:38
Vec2< int > Vec2i
Vec2 of int.
Definition: libwps_internal.h:702
void setPosition(Vec2i posi)
set the cell positions : 0,0 -> A1, 0,1 -> A2
Definition: WPSCell.h:340
libwps_tools_win::Font::Type m_type
font encoding type
Definition: Multiplan.cpp:63
void parse(librevenge::RVNGSpreadsheetInterface *documentInterface) final
called by WPSDocument to parse the file
Definition: Multiplan.cpp:259
Definition: Multiplan.cpp:960
Font(libwps_tools_win::Font::Type type)
constructor
Definition: Multiplan.cpp:57
What m_type
the type
Definition: WKSContentListener.h:77
std::shared_ptr< MultiplanParserInternal::State > m_state
the listener (if set)
Definition: Multiplan.h:130
Vec2i m_position[2]
cell position ( if type==F_Cell or F_CellList )
Definition: WKSContentListener.h:85
bool readFunctionNamesList()
try to read the function names: v2
Definition: Multiplan.cpp:876
std::shared_ptr< WPSListener > WPSListenerPtr
shared pointer to WPSListener
Definition: libwps_internal.h:105
internal class used to create a RVNGInputStream from a unsigned char's pointer
Definition: WPSStringStream.h:41
@ Undef
Definition: Multiplan.cpp:96
@ FileName
Definition: Multiplan.cpp:95
std::map< int, std::vector< int > > m_cellPositionsMap
the positions of each cell: a vector for each row
Definition: Multiplan.cpp:181
bool checkFilePosition(long pos)
return true if the pos is in the file, update the file size if need
Definition: Multiplan.cpp:238
std::vector< int > m_columnWidths
the columns width in char, 0 means default
Definition: Multiplan.cpp:177
bool readFilename(int pos, librevenge::RVNGString &filename)
read a link filename
Definition: Multiplan.cpp:1957
RVNGInputStreamPtr & getInput()
Definition: WKSParser.h:41
Definition: libwps_internal.h:151
Definition: libwps_internal.h:156
bool sendSpreadsheet()
try to send the main spreadsheet
Definition: Multiplan.cpp:2660
libwps_tools_win::Font::Type getDefaultFontType() const
return the default font style
Definition: Multiplan.cpp:150
bool readSharedData(int pos, int cellType, Vec2i const &cellPos, WKSContentListener::CellContent &content)
read a shared data
Definition: Multiplan.cpp:2092
#define WPS_DEBUG_MSG(M)
Definition: libwps_internal.h:134
#define WPS_FALLTHROUGH
fall through attributes
Definition: libwps_internal.h:82
void setBegin(long off)
sets the begin offset
Definition: WPSEntry.h:57
librevenge::RVNGString m_sheetName[2]
the sheet name
Definition: WKSContentListener.h:89
@ Zone0
Definition: Multiplan.cpp:95
small class use to define a formula instruction
Definition: WKSContentListener.h:57
static void addNote(char const *)
Definition: WPSDebug.h:221
Vec2i m_maximumCell
the maximumCell
Definition: Multiplan.cpp:175
long begin() const
returns the begin offset
Definition: WPSEntry.h:73
static const char * s_listFunctionsV2[]
Definition: Multiplan.cpp:1374
a data cell zone
Definition: Multiplan.cpp:92
@ WPS_SPREADSHEET
Definition: WPSDocument.h:61
bool sendContent(WPSListenerPtr &) final
call when the content of a cell must be send
Definition: Multiplan.cpp:80
~Font() final
destructor
Definition: Multiplan.cpp:66
int m_hash
the file hash
Definition: Multiplan.cpp:194
int8_t read8(librevenge::RVNGInputStream *input)
Definition: libwps_internal.cpp:59
double m_size
font size
Definition: WPSFont.h:85
std::set< int > m_posToSharedDataSeen
a set a shared data already seen
Definition: Multiplan.cpp:189
bool readDouble8(RVNGInputStreamPtr &input, double &res, bool &isNaN)
read a double store with 8 bytes: mantisse 6.5 bytes, exponent 1.5 bytes
Definition: libwps_internal.cpp:173
libwps_tools_win::Font::Type m_fontType
the user font type
Definition: Multiplan.cpp:173
WPSEntry m_textEntry
the cell string
Definition: WKSContentListener.h:153
long length() const
returns the length of the zone
Definition: WPSEntry.h:83
static std::shared_ptr< WKSContentListener > createListener(librevenge::RVNGSpreadsheetInterface *interface)
creates the main listener
Definition: Multiplan.cpp:304
std::shared_ptr< WPSHeader > WPSHeaderPtr
shared pointer to WPSHeader
Definition: libwps_internal.h:109
ContentType m_contentType
the content type ( by default unknown )
Definition: WKSContentListener.h:147
a structure used to defined the cell position, and a format
Definition: WPSCell.h:290
Definition: WPSDebug.h:191
uint8_t readU8(librevenge::RVNGInputStream *input)
Definition: libwps_internal.cpp:40
std::set< int > m_positionsSet
list of position in the zone
Definition: Multiplan.cpp:125
std::map< int, WKSContentListener::FormulaInstruction > m_posToNameMap
the map name's pos to name's cell instruction
Definition: Multiplan.cpp:187
Type
the different enum type
Definition: Multiplan.cpp:95
Definition: WPSPageSpan.h:38
std::string m_content
the content ( if type == F_Operator or type = F_Function or type==F_Text)
Definition: WKSContentListener.h:79
void setEnd(long e)
sets the end offset
Definition: WPSEntry.h:67
uint16_t readU16(librevenge::RVNGInputStream *input)
Definition: libwps_internal.cpp:64
int m_arity
Definition: Multiplan.cpp:963
@ Link
Definition: Multiplan.cpp:95
std::shared_ptr< librevenge::RVNGInputStream > RVNGInputStreamPtr
shared pointer to librevenge::RVNGInputStream
Definition: libwps_internal.h:87
static WPSFont getDefaultFont()
returns a default font (Courier12) with file's version to define the default encoding */
Definition: Multiplan.cpp:158
bool readZonesList()
read the spreadsheet zone list
Definition: Multiplan.cpp:610
bool readDouble(double &value)
try to read a double value
Definition: Multiplan.cpp:904
int m_version
the file version
Definition: Multiplan.cpp:171
WPSFont & operator=(WPSFont const &)=default
static void addDelimiter(long, char)
Definition: WPSDebug.h:222
bool readDataToEnd(RVNGInputStreamPtr &input, librevenge::RVNGBinaryData &data)
try to read the last bytes from input and store them in a librevenge::RVNGBinaryData
Definition: libwps_internal.cpp:346
static std::string getName(int type)
returns the name corresponding to a type
Definition: Multiplan.cpp:110
Cell()
constructor
Definition: Multiplan.cpp:75
libwps_tools_win::Font::Type getDefaultFontType() const
returns the default font type, ie.
Definition: Multiplan.cpp:251
int16_t read16(librevenge::RVNGInputStream *input)
Definition: libwps_internal.cpp:71
int m_checksum
the file checksum
Definition: Multiplan.cpp:196
@ CellPosition
Definition: Multiplan.cpp:96
libwps::DebugFile & ascii()
a DebugFile used to write what we recognize when we parse the document
Definition: WKSParser.h:63
Vec2b m_positionRelative[2]
relative cell position ( if type==F_Cell or F_CellList )
Definition: WKSContentListener.h:87
bool readLink(int pos, WKSContentListener::FormulaInstruction &instruction)
read a link
Definition: Multiplan.cpp:1872
@ C_TEXT
Definition: WKSContentListener.h:102
WPSBox2< int > WPSBox2i
WPSBox2 of int.
Definition: libwps_internal.h:888
bool readName(int pos, WKSContentListener::FormulaInstruction &instruction)
reads a name and returns the cell's instruction
Definition: Multiplan.cpp:1989
@ Name
Definition: Multiplan.cpp:95
@ CellData
Definition: Multiplan.cpp:96
Vec2< bool > Vec2b
Vec2 of bool.
Definition: libwps_internal.h:700
void setValue(double value)
sets the double value
Definition: WKSContentListener.h:126
Definition: WKSContentListener.h:53
small class use to define a sheet cell content
Definition: WKSContentListener.h:99
the font of a MultiplanParser
Definition: Multiplan.cpp:54
bool readFormula(Vec2i const &cellPos, std::vector< WKSContentListener::FormulaInstruction > &formula, long endPos, std::string &extra)
try to read a formula
Definition: Multiplan.cpp:1046
bool readZones()
finds the different zones (spreadsheet, chart, print, ...)
Definition: Multiplan.cpp:472
@ F_CellList
Definition: WKSContentListener.h:59
bool isValid() const
returns true if the zone entry is valid
Definition: Multiplan.cpp:105
static const Functions s_listOperators[]
Definition: Multiplan.cpp:966
a cellule of a Lotus spreadsheet
Definition: Multiplan.cpp:71
@ C_NUMBER
Definition: WKSContentListener.h:102
bool readColumnsWidth()
read the columns width
Definition: Multiplan.cpp:581
librevenge::RVNGString m_name
font name
Definition: WPSFont.h:83
static void setStream(RVNGInputStreamPtr)
Definition: WPSDebug.h:212
State(libwps_tools_win::Font::Type fontType, char const *password)
constructor
Definition: Multiplan.cpp:131
const char * m_password
the password (if known)
Definition: Multiplan.cpp:192
Definition: WKSParser.h:33
Generated on Sat Apr 18 2020 13:44:19 for libwps by
doxygen 1.8.17