WPSOLE1Parser.h
Go to the documentation of this file.
1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*- */
2 /* libwps
3  * Version: MPL 2.0 / LGPLv2.1+
4  *
5  * This Source Code Form is subject to the terms of the Mozilla Public
6  * License, v. 2.0. If a copy of the MPL was not distributed with this
7  * file, You can obtain one at http://mozilla.org/MPL/2.0/.
8  *
9  * Major Contributor(s):
10  * Copyright (C) 2009, 2011 Alonso Laurent (alonso@loria.fr)
11  * Copyright (C) 2006, 2007 Andrew Ziem
12  * Copyright (C) 2004-2006 Fridrich Strba (fridrich.strba@bluewin.ch)
13  * Copyright (C) 2004 Marc Maurer (uwog@uwog.net)
14  * Copyright (C) 2003-2005 William Lachance (william.lachance@sympatico.ca)
15  *
16  * For minor contributions see the git repository.
17  *
18  * Alternatively, the contents of this file may be used under the terms
19  * of the GNU Lesser General Public License Version 2.1 or later
20  * (LGPLv2.1+), in which case the provisions of the LGPLv2.1+ are
21  * applicable instead of those above.
22  *
23  * For further information visit http://libwps.sourceforge.net
24  */
25 
26 /*
27  */
28 
29 #ifndef WPS_OLE1_PARSER_H
30 #define WPS_OLE1_PARSER_H
31 
32 #include <string>
33 
34 #include <librevenge-stream/librevenge-stream.h>
35 
36 #include "libwps_internal.h"
37 #include "libwps_tools_win.h"
38 
39 namespace WPSOLE1ParserInternal
40 {
41 struct State;
42 struct OLEZone;
43 }
44 
50 {
51 public:
53  explicit WPSOLE1Parser(std::shared_ptr<WPSStream> const &fileStream);
54 
57 
59  bool createZones();
60 
69  std::shared_ptr<WPSStream> getStreamForName(std::string const &name) const;
71  std::shared_ptr<WPSStream> getStreamForId(int id) const;
73  bool updateMetaData(librevenge::RVNGPropertyList &list, libwps_tools_win::Font::Type encoding) const;
75  bool updateEmbeddedObject(int id, WPSEmbeddedObject &object) const;
76 
77 protected:
81  std::shared_ptr<WPSStream> getStream(WPSOLE1ParserInternal::OLEZone const &zone) const;
83  void checkIfParsed(WPSOLE1ParserInternal::OLEZone const &zone) const;
84 
85 private:
87  std::shared_ptr<WPSOLE1ParserInternal::State> m_state;
88 };
89 
90 #endif
91 /* vim:set shiftwidth=4 softtabstop=4 noexpandtab: */
WPSOLE1ParserInternal
Definition: WPSOLE1Parser.cpp:46
WPSOLEObject.h
WPSOLE1Parser::updateEmbeddedObject
bool updateEmbeddedObject(int id, WPSEmbeddedObject &object) const
try to retrieve the content of a graphic, knowing it local id
Definition: WPSOLE1Parser.cpp:442
libwps::DebugStream::str
static std::string str()
Definition: WPSDebug.h:200
WPSStream::checkFilePosition
bool checkFilePosition(long pos) const
return true if the position is in the file
Definition: WPSStream.h:38
libwps::DebugFile::addPos
static void addPos(long)
Definition: WPSDebug.h:220
WPSOLE1ParserInternal::OLEZone::OLEZone
OLEZone(int levl)
constructor
Definition: WPSOLE1Parser.cpp:52
libwps_tools_win::Font::Type
Type
enum Type
Definition: libwps_tools_win.h:46
WPSOLE1Parser::updateZoneNames
bool updateZoneNames(WPSOLE1ParserInternal::OLEZone &zone) const
try to update the zone name
Definition: WPSOLE1Parser.cpp:368
WPSOLE1ParserInternal::State
Internal: internal method to keep ole1 state.
Definition: WPSOLE1Parser.cpp:84
libwps
Definition: libwps_internal.cpp:38
WPSStream
small structure use to store a stream and it debug file
Definition: WPSStream.h:29
WPSOLE1Parser::getStream
std::shared_ptr< WPSStream > getStream(WPSOLE1ParserInternal::OLEZone const &zone) const
try to return a stream correponding to a zone
Definition: WPSOLE1Parser.cpp:401
WPSOLE1ParserInternal::State::State
State(std::shared_ptr< WPSStream > const &fileStream)
constructor
Definition: WPSOLE1Parser.cpp:87
libwps_tools_win::Font::unicodeString
static librevenge::RVNGString unicodeString(const unsigned char *p, unsigned long size, Type type, bool skipUnknown=true)
converts a list of character in unicode
Definition: libwps_tools_win.cpp:7283
WPSOLE1ParserInternal::State::m_idToTypeNameMap
std::map< int, std::string > m_idToTypeNameMap
the map id to zone type
Definition: WPSOLE1Parser.cpp:98
WPSOLE1Parser::createZones
bool createZones()
try to find the different zones
Definition: WPSOLE1Parser.cpp:140
WPSOLE1Parser::~WPSOLE1Parser
~WPSOLE1Parser()
destructor
Definition: WPSOLE1Parser.cpp:127
WPSOLE1ParserInternal::OLEZone::m_parsed
bool m_parsed
a flag to know if the zone is parsed
Definition: WPSOLE1Parser.cpp:80
WPSOLE1ParserInternal::OLEZone::m_childList
std::vector< OLEZone > m_childList
the list of child
Definition: WPSOLE1Parser.cpp:76
WPSStringStream
internal class used to create a RVNGInputStream from a unsigned char's pointer
Definition: WPSStringStream.h:41
WPSOLE1ParserInternal::OLEZone::m_defPosition
long m_defPosition
the position where this zone is defined
Definition: WPSOLE1Parser.cpp:66
WPSOLE1Parser::updateMetaData
bool updateMetaData(librevenge::RVNGPropertyList &list, libwps_tools_win::Font::Type encoding) const
try to retrieve the meta data
Definition: WPSOLE1Parser.cpp:482
WPSOLE1Parser.h
WPS_DEBUG_MSG
#define WPS_DEBUG_MSG(M)
Definition: libwps_internal.h:134
libwps::readU32
uint32_t readU32(librevenge::RVNGInputStream *input)
Definition: libwps_internal.cpp:76
WPSOLEObject::readOLE
static bool readOLE(std::shared_ptr< WPSStream > stream, WPSEmbeddedObject &object, long endPos=-1)
try to read a OLE: 0x0105 ...
Definition: WPSOLEObject.cpp:139
WPSOLE1ParserInternal::OLEZone::m_level
int m_level
the level
Definition: WPSOLE1Parser.cpp:64
WPSOLE1Parser::m_state
std::shared_ptr< WPSOLE1ParserInternal::State > m_state
a smart ptr used to stored the file data
Definition: WPSOLE1Parser.h:87
WPSOLE1Parser::checkIfParsed
void checkIfParsed(WPSOLE1ParserInternal::OLEZone const &zone) const
check for unparsed zone
Definition: WPSOLE1Parser.cpp:624
WPSOLE1Parser
a class used to parse a container which is used by Lotus123 (and also by RagTime).
Definition: WPSOLE1Parser.h:49
WPSOLE1ParserInternal::State::m_idToZoneMap
std::map< int, OLEZone > m_idToZoneMap
the map id to zone
Definition: WPSOLE1Parser.cpp:96
WPSStream::m_input
RVNGInputStreamPtr m_input
the stream
Definition: WPSStream.h:43
libwps::DebugFile::addNote
static void addNote(char const *)
Definition: WPSDebug.h:221
WPSEmbeddedObject
small class use to define a embedded object
Definition: libwps_internal.h:1076
WPSOLE1ParserInternal::OLEZone::m_names
std::string m_names[2]
the list of names
Definition: WPSOLE1Parser.cpp:78
WPSOLE1Parser::getStreamForName
std::shared_ptr< WPSStream > getStreamForName(std::string const &name) const
try to return a string corresponding to a name:
Definition: WPSOLE1Parser.cpp:346
WPSOLE1ParserInternal::OLEZone::m_lengthList
std::vector< long > m_lengthList
the list of length
Definition: WPSOLE1Parser.cpp:74
libwps::DebugStream
Definition: WPSDebug.h:191
WPSOLE1ParserInternal::OLEZone::m_idsList
std::vector< int > m_idsList
the list of pair id:type
Definition: WPSOLE1Parser.cpp:70
libwps::readU8
uint8_t readU8(librevenge::RVNGInputStream *input)
Definition: libwps_internal.cpp:40
WPSOLE1Parser::getStreamForId
std::shared_ptr< WPSStream > getStreamForId(int id) const
try to return a string corresponding to some id
Definition: WPSOLE1Parser.cpp:358
libwps_tools_win.h
WPSStream::m_ascii
libwps::DebugFile & m_ascii
the ascii file
Definition: WPSStream.h:45
libwps::readU16
uint16_t readU16(librevenge::RVNGInputStream *input)
Definition: libwps_internal.cpp:64
libwps_tools_win::Language::name
std::string name(long id)
returns the name given Windows© id
Definition: libwps_tools_win.cpp:7332
WPSOLE1ParserInternal::State::m_fileStream
std::shared_ptr< WPSStream > m_fileStream
the file stream
Definition: WPSOLE1Parser.cpp:94
RVNGInputStreamPtr
std::shared_ptr< librevenge::RVNGInputStream > RVNGInputStreamPtr
shared pointer to librevenge::RVNGInputStream
Definition: libwps_internal.h:87
WPSDebug.h
libwps::DebugFile::addDelimiter
static void addDelimiter(long, char)
Definition: WPSDebug.h:222
WPSOLE1ParserInternal::OLEZone
an OLE Zone
Definition: WPSOLE1Parser.cpp:49
WPSOLE1ParserInternal::State::m_pictureIdToZoneIdList
std::vector< int > m_pictureIdToZoneIdList
a map local id to picture id zone
Definition: WPSOLE1Parser.cpp:100
libwps_internal.h
WPSOLE1ParserInternal::State::m_pictureIdToZoneIdListCreated
bool m_pictureIdToZoneIdListCreated
a flag to know if the pictureIdToZoneIdList is created
Definition: WPSOLE1Parser.cpp:102
WPSOLE1ParserInternal::OLEZone::m_beginList
std::vector< long > m_beginList
the list of pointers
Definition: WPSOLE1Parser.cpp:72
WPSOLE1Parser::WPSOLE1Parser
WPSOLE1Parser(std::shared_ptr< WPSStream > const &fileStream)
constructor knowing the file stream
Definition: WPSOLE1Parser.cpp:122
WPSStream.h
libwps::DebugFile
Definition: WPSDebug.h:207
WPSOLE1ParserInternal::OLEZone::m_varIdToValueMap
std::map< int, unsigned long > m_varIdToValueMap
a list of variable
Definition: WPSOLE1Parser.cpp:68
WPSStringStream.h

Generated on Sun Apr 5 2020 00:00:00 for libwps by doxygen 1.8.17