MacDocParser.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.
*/
#ifndef MAC_DOC_PARSER
# define MAC_DOC_PARSER
#include <string>
#include <vector>
#include <librevenge/librevenge.h>
#include "MWAWDebug.hxx"
#include "MWAWInputStream.hxx"
#include "MWAWParser.hxx"
namespace MacDocParserInternal
{
struct State;
}
class MacDocParser final : public MWAWTextParser
{
public:
MacDocParser(MWAWInputStreamPtr const &input, MWAWRSRCParserPtr const &rsrcParser, MWAWHeader *header);
~MacDocParser() final;
bool checkHeader(MWAWHeader *header, bool strict=false) final;
// the main parse function
void parse(librevenge::RVNGTextInterface *documentInterface) final;
protected:
void init();
void createDocument(librevenge::RVNGTextInterface *documentInterface);
void newPage(int number);
protected:
bool createZones();
bool sendContents();
// Intermediate level
bool sendPicture(MWAWEntry const &entry);
bool readFont(MWAWEntry const &entry);
bool readIndex(MWAWEntry const &entry);
int updateIndex(int actIndex, int actLevel);
bool readBookmark(MWAWEntry const &entry);
bool readFile(MWAWEntry const &entry);
bool readWP(MWAWEntry const &entry);
bool sendIndex();
MWAWInputStreamPtr rsrcInput();
libmwaw::DebugFile &rsrcAscii();
//
// data
//
std::shared_ptr<MacDocParserInternal::State> m_state;
};
#endif
// vim: set filetype=cpp tabstop=2 shiftwidth=2 cindent autoindent smartindent noexpandtab:
MWAWDebug.hxx
MWAWInputStream.hxx
MWAWParser.hxx
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
MWAWTextParser::MWAWTextParser
MWAWTextParser(MWAWInputStreamPtr const &input, MWAWRSRCParserPtr const &rsrcParser, MWAWHeader *header)
constructor (protected)
Definition MWAWParser.hxx:307
MacDocParser::readFont
bool readFont(MWAWEntry const &entry)
try to read a font index entry
Definition MacDocParser.cxx:355
MacDocParser::readIndex
bool readIndex(MWAWEntry const &entry)
try to read an index entry
Definition MacDocParser.cxx:409
MacDocParser::sendContents
bool sendContents()
try to send the contents
Definition MacDocParser.cxx:330
MacDocParser::readWP
bool readWP(MWAWEntry const &entry)
try to read a MDwp entry (window pos?)
Definition MacDocParser.cxx:660
MacDocParser::~MacDocParser
~MacDocParser() final
destructor
Definition MacDocParser.cxx:131
MacDocParser::rsrcInput
MWAWInputStreamPtr rsrcInput()
return the input input
Definition MacDocParser.cxx:145
MacDocParser::readBookmark
bool readBookmark(MWAWEntry const &entry)
try to read a bookmark entry
Definition MacDocParser.cxx:637
MacDocParser::MacDocParser
MacDocParser(MWAWInputStreamPtr const &input, MWAWRSRCParserPtr const &rsrcParser, MWAWHeader *header)
constructor
Definition MacDocParser.cxx:124
MacDocParser::checkHeader
bool checkHeader(MWAWHeader *header, bool strict=false) final
checks if the document header is correct (or not)
Definition MacDocParser.cxx:686
MacDocParser::parse
void parse(librevenge::RVNGTextInterface *documentInterface) final
virtual function used to parse the input
Definition MacDocParser.cxx:174
MacDocParser::newPage
void newPage(int number)
adds a new page
Definition MacDocParser.cxx:158
MacDocParser::sendPicture
bool sendPicture(MWAWEntry const &entry)
try to send a picture
Definition MacDocParser.cxx:574
MacDocParser::rsrcAscii
libmwaw::DebugFile & rsrcAscii()
a DebugFile used to write what we recognize when we parse the document in rsrc
Definition MacDocParser.cxx:150
MacDocParser::updateIndex
int updateIndex(int actIndex, int actLevel)
try to set the index level and return the next index value (or -1)
Definition MacDocParser.cxx:489
MacDocParser::readFile
bool readFile(MWAWEntry const &entry)
try to read a file entry
Definition MacDocParser.cxx:612
MacDocParser::sendIndex
bool sendIndex()
try to send the index
Definition MacDocParser.cxx:506
MacDocParser::m_state
std::shared_ptr< MacDocParserInternal::State > m_state
the state
Definition MacDocParser.hxx:115
MacDocParser::createDocument
void createDocument(librevenge::RVNGTextInterface *documentInterface)
creates the listener which will be associated to the document
Definition MacDocParser.cxx:199
MacDocParser::init
void init()
inits all internal variables
Definition MacDocParser.cxx:135
MacDocParser::createZones
bool createZones()
finds the different objects zones
Definition MacDocParser.cxx:229
libmwaw::DebugFile
Definition MWAWDebug.hxx:66
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
MacDocParserInternal
Internal: the structures of a MacDocParser.
Definition MacDocParser.cxx:60
MacDocParserInternal::State
Internal: the state of a MacDocParser.
Definition MacDocParser.cxx:100