MultiplanParser.hxx
Go to the documentation of this file.
/* -*- Mode: C++; c-default-style: "k&r"; indent-tabs-mode: nil; tab-width: 2; c-basic-offset: 2 -*- */
/* libmwaw
* Version: MPL 2.0 / LGPLv2+
*
* The contents of this file are subject to the Mozilla Public License Version
* 2.0 (the "License"); you may not use this file except in compliance with
* the License or as specified alternatively below. You may obtain a copy of
* the License at http://www.mozilla.org/MPL/
*
* Software distributed under the License is distributed on an "AS IS" basis,
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
* for the specific language governing rights and limitations under the
* License.
*
* Major Contributor(s):
* Copyright (C) 2002 William Lachance (wrlach@gmail.com)
* Copyright (C) 2002,2004 Marc Maurer (uwog@uwog.net)
* Copyright (C) 2004-2006 Fridrich Strba (fridrich.strba@bluewin.ch)
* Copyright (C) 2006, 2007 Andrew Ziem
* Copyright (C) 2011, 2012 Alonso Laurent (alonso@loria.fr)
*
*
* All Rights Reserved.
*
* For minor contributions see the git repository.
*
* Alternatively, the contents of this file may be used under the terms of
* the GNU Lesser General Public License Version 2 or later (the "LGPLv2+"),
* in which case the provisions of the LGPLv2+ are applicable
* instead of those above.
*/
/*
* Parser to convert spreadsheet Multiplan document
*
*/
#ifndef MULTIPLAN_PARSER
# define MULTIPLAN_PARSER
#include <vector>
#include "MWAWCell.hxx"
#include "MWAWDebug.hxx"
#include "MWAWParser.hxx"
namespace MultiplanParserInternal
{
struct State;
class SubDocument;
}
class MultiplanParser final : public MWAWSpreadsheetParser
{
friend class MultiplanParserInternal::SubDocument;
public:
MultiplanParser(MWAWInputStreamPtr const &input, MWAWRSRCParserPtr const &rsrcParser, MWAWHeader *header);
~MultiplanParser() final;
bool checkHeader(MWAWHeader *header, bool strict=false) final;
void parse(librevenge::RVNGSpreadsheetInterface *documentInterface) final;
protected:
void createDocument(librevenge::RVNGSpreadsheetInterface *documentInterface);
bool createZones();
bool readColumnsPos();
bool readHeaderFooter();
bool readPrinterInfo();
bool readPrinterMessage();
bool readZonesList();
bool readZone1(MWAWEntry const &entry);
bool readCellDataPosition(MWAWEntry const &entry);
bool readLink(int pos, MWAWCellContent::FormulaInstruction &instruction);
bool readLinkFilename(int pos, MWAWCellContent::FormulaInstruction &instruction);
bool readSharedData(int pos, int cellType, MWAWVec2i const &cellPos, MWAWCellContent &content);
bool readName(int pos, MWAWCellContent::FormulaInstruction &instruction);
bool readZoneB();
bool readZoneC();
bool sendSpreadsheet();
bool sendText(MWAWEntry const &entry);
bool sendCell(MWAWVec2i const &cellPos, int pos);
protected:
bool readDouble(double &value);
bool readFormula(MWAWVec2i const &cellPos, std::vector<MWAWCellContent::FormulaInstruction> &formula, long endPos, std::string &extra);
//
// data
//
std::shared_ptr<MultiplanParserInternal::State> m_state;
};
#endif
// vim: set filetype=cpp tabstop=2 shiftwidth=2 cindent autoindent smartindent noexpandtab:
MWAWCell.hxx
Defines MWAWCell (cell content and format).
MWAWDebug.hxx
MWAWParser.hxx
MWAWCellContent
small class use to define a sheet cell content
Definition MWAWCell.hxx:394
MWAWEntry
basic class to store an entry in a file This contained :
Definition MWAWEntry.hxx:47
MWAWHeader
a function used by MWAWDocument to store the version of document
Definition MWAWHeader.hxx:57
MWAWSpreadsheetParser::MWAWSpreadsheetParser
MWAWSpreadsheetParser(MWAWInputStreamPtr const &input, MWAWRSRCParserPtr const &rsrcParser, MWAWHeader *header)
constructor (protected)
Definition MWAWParser.hxx:291
MultiplanParserInternal::SubDocument
Internal: the subdocument of a MultiplanParserInternal.
Definition MultiplanParser.cxx:122
MultiplanParser::checkHeader
bool checkHeader(MWAWHeader *header, bool strict=false) final
checks if the document header is correct (or not)
Definition MultiplanParser.cxx:1368
MultiplanParser::readFormula
bool readFormula(MWAWVec2i const &cellPos, std::vector< MWAWCellContent::FormulaInstruction > &formula, long endPos, std::string &extra)
try to read a formula
Definition MultiplanParser.cxx:1069
MultiplanParser::sendSpreadsheet
bool sendSpreadsheet()
try to send the main spreadsheet
Definition MultiplanParser.cxx:1666
MultiplanParser::readColumnsPos
bool readColumnsPos()
read the columns limits pos
Definition MultiplanParser.cxx:384
MultiplanParser::sendCell
bool sendCell(MWAWVec2i const &cellPos, int pos)
try to send a cell
Definition MultiplanParser.cxx:1454
MultiplanParser::readName
bool readName(int pos, MWAWCellContent::FormulaInstruction &instruction)
reads a name and returns the cell's instruction
Definition MultiplanParser.cxx:802
MultiplanParser::MultiplanParser
MultiplanParser(MWAWInputStreamPtr const &input, MWAWRSRCParserPtr const &rsrcParser, MWAWHeader *header)
constructor
Definition MultiplanParser.cxx:169
MultiplanParser::sendText
bool sendText(MWAWEntry const &entry)
try to send a text zone
Definition MultiplanParser.cxx:1428
MultiplanParser::readHeaderFooter
bool readHeaderFooter()
read the header/footer strings, ...
Definition MultiplanParser.cxx:269
MultiplanParser::readLinkFilename
bool readLinkFilename(int pos, MWAWCellContent::FormulaInstruction &instruction)
read a link filename
Definition MultiplanParser.cxx:647
MultiplanParser::readSharedData
bool readSharedData(int pos, int cellType, MWAWVec2i const &cellPos, MWAWCellContent &content)
read a shared data
Definition MultiplanParser.cxx:695
MultiplanParser::createDocument
void createDocument(librevenge::RVNGSpreadsheetInterface *documentInterface)
creates the listener which will be associated to the document
Definition MultiplanParser.cxx:213
MultiplanParser::parse
void parse(librevenge::RVNGSpreadsheetInterface *documentInterface) final
the main parse function
Definition MultiplanParser.cxx:185
MultiplanParser::readLink
bool readLink(int pos, MWAWCellContent::FormulaInstruction &instruction)
read a link given a position
Definition MultiplanParser.cxx:551
MultiplanParser::~MultiplanParser
~MultiplanParser() final
destructor
Definition MultiplanParser.cxx:178
MultiplanParser::readPrinterInfo
bool readPrinterInfo()
read the printer information
Definition MultiplanParser.cxx:295
MultiplanParser::readCellDataPosition
bool readCellDataPosition(MWAWEntry const &entry)
read the cell data position
Definition MultiplanParser.cxx:516
MultiplanParser::readZonesList
bool readZonesList()
read the spreadsheet zone list
Definition MultiplanParser.cxx:404
MultiplanParser::createZones
bool createZones()
finds the different objects zones
Definition MultiplanParser.cxx:245
MultiplanParser::readZoneB
bool readZoneB()
read an unknown zone
Definition MultiplanParser.cxx:856
MultiplanParser::m_state
std::shared_ptr< MultiplanParserInternal::State > m_state
the state
Definition MultiplanParser.hxx:127
MultiplanParser::readZoneC
bool readZoneC()
read an unknown zone
Definition MultiplanParser.cxx:906
MultiplanParser::readPrinterMessage
bool readPrinterMessage()
read the printer message
Definition MultiplanParser.cxx:362
MultiplanParser::readZone1
bool readZone1(MWAWEntry const &entry)
read an unknown zone: two blocks of 60 bytes
Definition MultiplanParser.cxx:488
MultiplanParser::readDouble
bool readDouble(double &value)
try to read a double value
Definition MultiplanParser.cxx:946
MWAWVec2i
MWAWVec2< int > MWAWVec2i
MWAWVec2 of int.
Definition libmwaw_internal.hxx:838
MWAWRSRCParserPtr
std::shared_ptr< MWAWRSRCParser > MWAWRSRCParserPtr
a smart pointer of MWAWRSRCParser
Definition libmwaw_internal.hxx:561
MWAWInputStreamPtr
std::shared_ptr< MWAWInputStream > MWAWInputStreamPtr
a smart pointer of MWAWInputStream
Definition libmwaw_internal.hxx:551
MultiplanParserInternal
Internal: the structures of a MultiplanParser.
Definition MultiplanParser.cxx:58
librevenge
Definition MWAWDocument.hxx:57
MultiplanParserInternal::State
Internal: the state of a MultiplanParser.
Definition MultiplanParser.cxx:61