WPSParser.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) 2002 William Lachance (william.lachance@sympatico.ca)
11  * Copyright (C) 2002 Marc Maurer (uwog@uwog.net)
12  *
13  * For minor contributions see the git repository.
14  *
15  * Alternatively, the contents of this file may be used under the terms
16  * of the GNU Lesser General Public License Version 2.1 or later
17  * (LGPLv2.1+), in which case the provisions of the LGPLv2.1+ are
18  * applicable instead of those above.
19  *
20  * For further information visit http://libwps.sourceforge.net
21  */
22 
23 #ifndef WPSPARSER_H
24 #define WPSPARSER_H
25 
26 #include <map>
27 #include <string>
28 
29 #include "libwps_internal.h"
30 
31 #include "WPSDebug.h"
32 
33 class WPSTextParser;
34 
35 class WPSParser
36 {
37  friend class WPSTextParser;
38 public:
40  typedef std::multimap<std::string, WPSEntry> NameMultiMap;
41 
42  WPSParser(RVNGInputStreamPtr &input, WPSHeaderPtr &header);
43  virtual ~WPSParser();
44  virtual void parse(librevenge::RVNGTextInterface *documentInterface) = 0;
45 
46 protected:
48  {
49  return m_input;
50  }
53  {
54  return m_header;
55  }
56  int version() const
57  {
58  return m_version;
59  }
60  void setVersion(int vers)
61  {
62  m_version=vers;
63  }
66  {
67  return m_asciiFile;
68  }
69 
71  {
72  return m_nameMultiMap;
73  }
75  {
76  return m_nameMultiMap;
77  }
78 
79 private:
80  explicit WPSParser(const WPSParser &) = delete;
81  WPSParser &operator=(const WPSParser &) = delete;
82 
83  // the main input
85  // the header
87  // the file version
88  int m_version;
91 
94 };
95 
96 #endif /* WPSPARSER_H */
97 /* vim:set shiftwidth=4 softtabstop=4 noexpandtab: */
virtual void parse(librevenge::RVNGTextInterface *documentInterface)=0
NameMultiMap & getNameEntryMap()
Definition: WPSParser.h:70
WPSParser(RVNGInputStreamPtr &input, WPSHeaderPtr &header)
Definition: WPSParser.cpp:30
libwps::DebugFile m_asciiFile
the debug file
Definition: WPSParser.h:90
WPSHeaderPtr & getHeader()
Definition: WPSParser.h:52
RVNGInputStreamPtr & getInput()
Definition: WPSParser.h:47
Definition: WPSDebug.h:207
int version() const
Definition: WPSParser.h:56
RVNGInputStreamPtr m_input
Definition: WPSParser.h:84
libwps::DebugFile & ascii()
a DebugFile used to write what we recognize when we parse the document
Definition: WPSParser.h:65
Definition: WPSParser.h:35
RVNGInputStreamPtr getFileInput()
Definition: WPSParser.cpp:45
NameMultiMap const & getNameEntryMap() const
Definition: WPSParser.h:74
std::multimap< std::string, WPSEntry > NameMultiMap
a map to retrieve a file entry by name
Definition: WPSParser.h:40
NameMultiMap m_nameMultiMap
a map to retrieve a file entry by name
Definition: WPSParser.h:93
std::shared_ptr< librevenge::RVNGInputStream > RVNGInputStreamPtr
shared pointer to librevenge::RVNGInputStream
Definition: libwps_internal.h:87
WPSHeaderPtr m_header
Definition: WPSParser.h:86
WPSParser & operator=(const WPSParser &)=delete
void setVersion(int vers)
Definition: WPSParser.h:60
int m_version
Definition: WPSParser.h:88
virtual ~WPSParser()
Definition: WPSParser.cpp:41
class used to defined the ancestor of parser which manages the text data
Definition: WPSTextParser.h:39
std::shared_ptr< WPSHeader > WPSHeaderPtr
shared pointer to WPSHeader
Definition: libwps_internal.h:109

Generated on Fri May 27 2022 03:07:00 for libwps by doxygen 1.8.14