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 WPXDocumentInterface;
34 
35 class WPSEntry;
36 class WPSHeader;
37 typedef shared_ptr<WPSHeader> WPSHeaderPtr;
38 
39 class WPSTextParser;
40 
41 class WPSParser
42 {
43  friend class WPSTextParser;
44 public:
45  WPSParser(WPXInputStreamPtr &input, WPSHeaderPtr &header);
46  virtual ~WPSParser();
47 
48  virtual void parse(WPXDocumentInterface *documentInterface) = 0;
49 
51  typedef std::multimap<std::string, WPSEntry> NameMultiMap;
52 
53 protected:
55  {
56  return m_input;
57  }
59  {
60  return m_header;
61  }
62  int version() const
63  {
64  return m_version;
65  }
66  void setVersion(int vers)
67  {
68  m_version=vers;
69  }
71  {
72  return m_nameMultiMap;
73  }
75  {
76  return m_nameMultiMap;
77  }
80  {
81  return m_asciiFile;
82  }
83 
84 private:
85  WPSParser(const WPSParser &);
86  WPSParser &operator=(const WPSParser &);
87 
88  // the main input
90  // the header
92  // the file version
93  int m_version;
98 };
99 
100 #endif /* WPSPARSER_H */
101 /* vim:set shiftwidth=4 softtabstop=4 noexpandtab: */
NameMultiMap & getNameEntryMap()
Definition: WPSParser.h:70
libwps::DebugFile m_asciiFile
the debug file
Definition: WPSParser.h:97
WPSParser & operator=(const WPSParser &)
WPSHeaderPtr & getHeader()
Definition: WPSParser.h:58
shared_ptr< WPXInputStream > WPXInputStreamPtr
Definition: libwps_internal.h:74
int version() const
Definition: WPSParser.h:62
Definition: WPSDebug.h:198
virtual void parse(WPXDocumentInterface *documentInterface)=0
NameMultiMap const & getNameEntryMap() const
Definition: WPSParser.h:74
libwps::DebugFile & ascii()
a DebugFile used to write what we recognize when we parse the document
Definition: WPSParser.h:79
Definition: WPSParser.h:41
WPSParser(WPXInputStreamPtr &input, WPSHeaderPtr &header)
Definition: WPSParser.cpp:30
std::multimap< std::string, WPSEntry > NameMultiMap
a map to retrieve a file entry by name
Definition: WPSParser.h:51
NameMultiMap m_nameMultiMap
a map to retrieve a file entry by name
Definition: WPSParser.h:95
Definition: WPSHeader.h:34
WPSHeaderPtr m_header
Definition: WPSParser.h:91
WPXInputStreamPtr & getInput()
Definition: WPSParser.h:54
shared_ptr< WPSHeader > WPSHeaderPtr
Definition: WPSHeader.h:66
WPXInputStreamPtr m_input
Definition: WPSParser.h:89
void setVersion(int vers)
Definition: WPSParser.h:66
basic class to store an entry in a file This contained :
Definition: WPSEntry.h:37
int m_version
Definition: WPSParser.h:93
virtual ~WPSParser()
Definition: WPSParser.cpp:38
class used to defined the ancestor of parser which manages the text data
Definition: WPSTextParser.h:39

Generated on Wed Jun 11 2014 02:26:01 for libwps by doxygen 1.8.5