JazzSSParser.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 Jazz document and some database
*
*/
#ifndef JAZZ_SS_PARSER
# define JAZZ_SS_PARSER
#include <string>
#include <vector>
#include "MWAWCell.hxx"
#include "MWAWDebug.hxx"
#include "MWAWParser.hxx"
namespace JazzSSParserInternal
{
struct State;
class SubDocument;
}
class JazzSSParser final : public MWAWSpreadsheetParser
{
friend class JazzSSParserInternal::SubDocument;
public:
JazzSSParser(MWAWInputStreamPtr const &input, MWAWRSRCParserPtr const &rsrcParser, MWAWHeader *header);
~JazzSSParser() final;
bool checkHeader(MWAWHeader *header, bool strict=false) final;
void parse(librevenge::RVNGSpreadsheetInterface *documentInterface) final;
protected:
void createDocument(librevenge::RVNGSpreadsheetInterface *documentInterface);
bool createZones();
bool sendSpreadsheet();
//
// low level
//
bool readZone11(long endPos);
bool readCell(int id, long endPos);
bool readSheetSize(long endPos);
bool readDocument(long endPos);
/* reads a cell */
bool readCell(MWAWVec2i actPos, MWAWCellContent::FormulaInstruction &instr);
/* reads a formula */
bool readFormula(long endPos, MWAWVec2i const &pos,
std::vector<MWAWCellContent::FormulaInstruction> &formula,
std::string &error);
protected:
//
// data
//
std::shared_ptr<JazzSSParserInternal::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
JazzSSParserInternal::SubDocument
Internal: the subdocument of a JazzSSParserInternal.
Definition JazzSSParser.cxx:105
JazzSSParser::readZone11
bool readZone11(long endPos)
reads a query/name/range... data (zone 11)
Definition JazzSSParser.cxx:319
JazzSSParser::checkHeader
bool checkHeader(MWAWHeader *header, bool strict=false) final
checks if the document header is correct (or not)
Definition JazzSSParser.cxx:1083
JazzSSParser::readDocument
bool readDocument(long endPos)
read the basic document zones (zone 15): selection, columns' width, default font, preferences....
Definition JazzSSParser.cxx:371
JazzSSParser::readFormula
bool readFormula(long endPos, MWAWVec2i const &pos, std::vector< MWAWCellContent::FormulaInstruction > &formula, std::string &error)
Definition JazzSSParser.cxx:884
JazzSSParser::~JazzSSParser
~JazzSSParser() final
destructor
Definition JazzSSParser.cxx:161
JazzSSParser::createDocument
void createDocument(librevenge::RVNGSpreadsheetInterface *documentInterface)
creates the listener which will be associated to the document
Definition JazzSSParser.cxx:196
JazzSSParser::m_state
std::shared_ptr< JazzSSParserInternal::State > m_state
the state
Definition JazzSSParser.hxx:119
JazzSSParser::createZones
bool createZones()
finds the different objects zones
Definition JazzSSParser.cxx:220
JazzSSParser::readCell
bool readCell(int id, long endPos)
reads a cell content data
Definition JazzSSParser.cxx:477
JazzSSParser::JazzSSParser
JazzSSParser(MWAWInputStreamPtr const &input, MWAWRSRCParserPtr const &rsrcParser, MWAWHeader *header)
constructor
Definition JazzSSParser.cxx:152
JazzSSParser::readSheetSize
bool readSheetSize(long endPos)
reads sheet size
Definition JazzSSParser.cxx:750
JazzSSParser::sendSpreadsheet
bool sendSpreadsheet()
sends the spreadsheet
Definition JazzSSParser.cxx:1136
JazzSSParser::parse
void parse(librevenge::RVNGSpreadsheetInterface *documentInterface) final
the main parse function
Definition JazzSSParser.cxx:168
MWAWCellContent
small class use to define a sheet cell content
Definition MWAWCell.hxx:394
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
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
JazzSSParserInternal
Internal: the structures of a JazzSSParser.
Definition JazzSSParser.cxx:59
librevenge
Definition MWAWDocument.hxx:57
JazzSSParserInternal::State
Internal: the state of a JazzSSParser.
Definition JazzSSParser.cxx:80