WPGXParser.h

Go to the documentation of this file.
00001 /* libwpg
00002  * Copyright (C) 2006 Ariya Hidayat (ariya@kde.org)
00003  * Copyright (C) 2004 Marc Oude Kotte (marc@solcon.nl)
00004  * Copyright (C) 2005 Fridrich Strba (fridrich.strba@bluewin.ch)
00005  *
00006  * This library is free software; you can redistribute it and/or
00007  * modify it under the terms of the GNU Library General Public
00008  * License as published by the Free Software Foundation; either
00009  * version 2 of the License, or (at your option) any later version.
00010  *
00011  * This library is distributed in the hope that it will be useful,
00012  * but WITHOUT ANY WARRANTY; without even the implied warranty of
00013  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00014  * Library General Public License for more details.
00015  *
00016  * You should have received a copy of the GNU Library General Public
00017  * License along with this library; if not, write to the 
00018  * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, 
00019  * Boston, MA  02111-1301 USA
00020  *
00021  * For further information visit http://libwpg.sourceforge.net
00022  */
00023 
00024 /* "This product is not manufactured, approved, or supported by
00025  * Corel Corporation or Corel Corporation Limited."
00026  */
00027 
00028 #ifndef __WPGXPARSER_H__
00029 #define __WPGXPARSER_H__
00030 
00031 #include "WPGPaintInterface.h"
00032 #include <libwpd/WPXStream.h>
00033 #include "WPGColor.h"
00034 
00035 #include <map>
00036 
00037 class WPGXParser
00038 {
00039 public:
00040         WPGXParser(WPXInputStream *input, libwpg::WPGPaintInterface* painter);
00041         WPGXParser(const WPGXParser& parser);
00042         virtual ~WPGXParser() {};
00043         virtual bool parse() = 0;
00044         
00045         unsigned char readU8();
00046         unsigned short readU16();  
00047         unsigned int readU32();  
00048         signed char readS8();
00049         short readS16();  
00050         int readS32();  
00051         unsigned int readVariableLengthInteger();
00052         WPGXParser& operator=(const WPGXParser& parser);
00053         
00054 protected:
00055         WPXInputStream* m_input;
00056         libwpg::WPGPaintInterface* m_painter;
00057         std::map<int,libwpg::WPGColor> m_colorPalette;
00058 };
00059 
00060 #endif // __WPGXPARSER_H__