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
33class WPSTextParser;
34
36{
37 friend class WPSTextParser;
38public:
40 typedef std::multimap<std::string, WPSEntry> NameMultiMap;
41
43 virtual ~WPSParser();
44 virtual void parse(librevenge::RVNGTextInterface *documentInterface) = 0;
45
46protected:
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 }
64
66 {
67 return m_asciiFile;
68 }
69
75 {
76 return m_nameMultiMap;
77 }
78
79private:
80 explicit WPSParser(const WPSParser &) = delete;
81 WPSParser &operator=(const WPSParser &) = delete;
82
83 // the main input
85 // the header
87 // the file version
91
94};
95
96#endif /* WPSPARSER_H */
97/* vim:set shiftwidth=4 softtabstop=4 noexpandtab: */
RVNGInputStreamPtr getFileInput()
Definition WPSParser.cpp:45
libwps::DebugFile m_asciiFile
the debug file
Definition WPSParser.h:90
int version() const
Definition WPSParser.h:56
NameMultiMap m_nameMultiMap
a map to retrieve a file entry by name
Definition WPSParser.h:93
virtual void parse(librevenge::RVNGTextInterface *documentInterface)=0
friend class WPSTextParser
Definition WPSParser.h:37
WPSParser & operator=(const WPSParser &)=delete
NameMultiMap const & getNameEntryMap() const
Definition WPSParser.h:74
int m_version
Definition WPSParser.h:88
void setVersion(int vers)
Definition WPSParser.h:60
RVNGInputStreamPtr & getInput()
Definition WPSParser.h:47
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
WPSParser(RVNGInputStreamPtr &input, WPSHeaderPtr &header)
Definition WPSParser.cpp:30
WPSParser(const WPSParser &)=delete
WPSHeaderPtr m_header
Definition WPSParser.h:86
std::multimap< std::string, WPSEntry > NameMultiMap
a map to retrieve a file entry by name
Definition WPSParser.h:40
NameMultiMap & getNameEntryMap()
Definition WPSParser.h:70
virtual ~WPSParser()
Definition WPSParser.cpp:41
WPSHeaderPtr & getHeader()
Definition WPSParser.h:52
class used to defined the ancestor of parser which manages the text data
Definition WPSTextParser.h:40
Definition WPSDebug.h:208
std::shared_ptr< WPSHeader > WPSHeaderPtr
shared pointer to WPSHeader
Definition libwps_internal.h:109
std::shared_ptr< librevenge::RVNGInputStream > RVNGInputStreamPtr
shared pointer to librevenge::RVNGInputStream
Definition libwps_internal.h:87

Generated on Sat Jul 19 2025 05:24:40 for libwps by doxygen 1.14.0