WKSParser.h
Go to the documentation of this file.
00001 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*- */
00002 /* libwps
00003  * Version: MPL 2.0 / LGPLv2.1+
00004  *
00005  * This Source Code Form is subject to the terms of the Mozilla Public
00006  * License, v. 2.0. If a copy of the MPL was not distributed with this
00007  * file, You can obtain one at http://mozilla.org/MPL/2.0/.
00008  *
00009  * Major Contributor(s):
00010  * Copyright (C) 2002 William Lachance (william.lachance@sympatico.ca)
00011  * Copyright (C) 2002 Marc Maurer (uwog@uwog.net)
00012  *
00013  * For minor contributions see the git repository.
00014  *
00015  * Alternatively, the contents of this file may be used under the terms
00016  * of the GNU Lesser General Public License Version 2.1 or later
00017  * (LGPLv2.1+), in which case the provisions of the LGPLv2.1+ are
00018  * applicable instead of those above.
00019  *
00020  * For further information visit http://libwps.sourceforge.net
00021  */
00022 
00023 #ifndef WKSPARSER_H
00024 #define WKSPARSER_H
00025 
00026 #include <map>
00027 #include <string>
00028 
00029 #include "libwps_internal.h"
00030 
00031 #include "WPSDebug.h"
00032 
00033 class WKSParser
00034 {
00035 public:
00036         WKSParser(RVNGInputStreamPtr &input, WPSHeaderPtr &header);
00037         virtual ~WKSParser();
00038         virtual void parse(librevenge::RVNGSpreadsheetInterface *documentInterface) = 0;
00039 
00040 protected:
00041         RVNGInputStreamPtr &getInput()
00042         {
00043                 return m_input;
00044         }
00045         RVNGInputStreamPtr getFileInput();
00046         WPSHeaderPtr &getHeader()
00047         {
00048                 return m_header;
00049         }
00050         int version() const
00051         {
00052                 return m_version;
00053         }
00054         void setVersion(int vers)
00055         {
00056                 m_version=vers;
00057         }
00059         libwps::DebugFile &ascii()
00060         {
00061                 return m_asciiFile;
00062         }
00063 
00064 private:
00065         WKSParser(const WKSParser &);
00066         WKSParser &operator=(const WKSParser &);
00067 
00068         // the main input
00069         RVNGInputStreamPtr m_input;
00070         // the header
00071         WPSHeaderPtr m_header;
00072         // the file version
00073         int m_version;
00075         libwps::DebugFile m_asciiFile;
00076 };
00077 
00078 #endif /* WKSPARSER_H */
00079 /* vim:set shiftwidth=4 softtabstop=4 noexpandtab: */