WKSParser.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 WKSPARSER_H
24#define WKSPARSER_H
25
26#include <map>
27#include <string>
28
29#include "libwps_internal.h"
30
31#include "WPSDebug.h"
32
33 class WKSParser
34{
35 public:
36 WKSParser(RVNGInputStreamPtr &input, WPSHeaderPtr &header);
37 virtual ~WKSParser();
38 virtual void parse(librevenge::RVNGSpreadsheetInterface *documentInterface) = 0;
39
40 protected:
41 RVNGInputStreamPtr &getInput()
42 {
43 return m_input;
44 }
45 void resetInput(RVNGInputStreamPtr const &newInput)
46 {
47 m_input=newInput;
48 }
49 RVNGInputStreamPtr getFileInput();
50 WPSHeaderPtr &getHeader()
51 {
52 return m_header;
53 }
54 int version() const
55 {
56 return m_version;
57 }
58 void setVersion(int vers)
59 {
60 m_version=vers;
61 }
62
63 libwps::DebugFile &ascii()
64 {
65 return m_asciiFile;
66 }
67
68 private:
69 WKSParser(const WKSParser &) = delete;
70 WKSParser &operator=(const WKSParser &) = delete;
71
72 // the main input
73 RVNGInputStreamPtr m_input;
74 // the header
75 WPSHeaderPtr m_header;
76 // the file version
77 int m_version;
79 libwps::DebugFile m_asciiFile;
80};
81
82#endif /* WKSPARSER_H */
83/* vim:set shiftwidth=4 softtabstop=4 noexpandtab: */
WPSDebug.h
WKSParser::getFileInput
RVNGInputStreamPtr getFileInput()
Definition WKSParser.cpp:44
WKSParser::operator=
WKSParser & operator=(const WKSParser &)=delete
WKSParser::WKSParser
WKSParser(const WKSParser &)=delete
WKSParser::WKSParser
WKSParser(RVNGInputStreamPtr &input, WPSHeaderPtr &header)
Definition WKSParser.cpp:30
WKSParser::m_version
int m_version
Definition WKSParser.h:77
WKSParser::getHeader
WPSHeaderPtr & getHeader()
Definition WKSParser.h:50
WKSParser::setVersion
void setVersion(int vers)
Definition WKSParser.h:58
WKSParser::m_asciiFile
libwps::DebugFile m_asciiFile
the debug file
Definition WKSParser.h:79
WKSParser::parse
virtual void parse(librevenge::RVNGSpreadsheetInterface *documentInterface)=0
WKSParser::m_input
RVNGInputStreamPtr m_input
Definition WKSParser.h:73
WKSParser::version
int version() const
Definition WKSParser.h:54
WKSParser::getInput
RVNGInputStreamPtr & getInput()
Definition WKSParser.h:41
WKSParser::~WKSParser
virtual ~WKSParser()
Definition WKSParser.cpp:40
WKSParser::ascii
libwps::DebugFile & ascii()
a DebugFile used to write what we recognize when we parse the document
Definition WKSParser.h:63
WKSParser::resetInput
void resetInput(RVNGInputStreamPtr const &newInput)
Definition WKSParser.h:45
WKSParser::m_header
WPSHeaderPtr m_header
Definition WKSParser.h:75
libwps::DebugFile
Definition WPSDebug.h:208
libwps_internal.h
WPSHeaderPtr
std::shared_ptr< WPSHeader > WPSHeaderPtr
shared pointer to WPSHeader
Definition libwps_internal.h:109
RVNGInputStreamPtr
std::shared_ptr< librevenge::RVNGInputStream > RVNGInputStreamPtr
shared pointer to librevenge::RVNGInputStream
Definition libwps_internal.h:87