Debian Codegraph @

src/lib/WPSParser.h

raw symbols SCIP
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 ([email protected])
11 * Copyright (C) 2002 Marc Maurer ([email protected])
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:
39 //! a map to retrieve a file entry by name
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:
47 RVNGInputStreamPtr &getInput()
48 {
49 return m_input;
50 }
51 RVNGInputStreamPtr getFileInput();
52 WPSHeaderPtr &getHeader()
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 }
64 //! a DebugFile used to write what we recognize when we parse the document
65 libwps::DebugFile &ascii()
66 {
67 return m_asciiFile;
68 }
69
70 NameMultiMap &getNameEntryMap()
71 {
72 return m_nameMultiMap;
73 }
74 NameMultiMap const &getNameEntryMap() const
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
84 RVNGInputStreamPtr m_input;
85 // the header
86 WPSHeaderPtr m_header;
87 // the file version
88 int m_version;
89 //! the debug file
90 libwps::DebugFile m_asciiFile;
91
92 //! a map to retrieve a file entry by name
93 NameMultiMap m_nameMultiMap;
94 };
95
96 #endif /* WPSPARSER_H */
97 /* vim:set shiftwidth=4 softtabstop=4 noexpandtab: */