WPXStreamImplementation.h
Go to the documentation of this file.
00001 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*- */
00002 /* libwpd
00003  * Copyright (C) 2006 Ariya Hidayat (ariya@kde.org)
00004  *
00005  * This library is free software; you can redistribute it and/or
00006  * modify it under the terms of the GNU Library General Public
00007  * License as published by the Free Software Foundation; either
00008  * version 2 of the License, or (at your option) any later version.
00009  *
00010  * This library is distributed in the hope that it will be useful,
00011  * but WITHOUT ANY WARRANTY; without even the implied warranty of
00012  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00013  * Library General Public License for more details.
00014  *
00015  * You should have received a copy of the GNU Library General Public
00016  * License along with this library; if not, write to the
00017  * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
00018  * Boston, MA  02111-1301 USA
00019  *
00020  * For further information visit http://libwpd.sourceforge.net
00021  */
00022 
00023 #ifndef __WPXSTREAMIMPLEMENTATION_H__
00024 #define __WPXSTREAMIMPLEMENTATION_H__
00025 
00026 #include "WPXStream.h"
00027 
00028 class WPXFileStreamPrivate;
00029 
00030 class WPXFileStream: public WPXInputStream
00031 {
00032 public:
00033         explicit WPXFileStream(const char *filename);
00034         ~WPXFileStream();
00035 
00036         const unsigned char *read(unsigned long numBytes, unsigned long &numBytesRead);
00037         long tell();
00038         int seek(long offset, WPX_SEEK_TYPE seekType);
00039         bool atEOS();
00040 
00041         bool isOLEStream();
00042         WPXInputStream *getDocumentOLEStream(const char *name);
00043 
00044 private:
00045         WPXFileStreamPrivate *d;
00046         WPXFileStream(const WPXFileStream &); // copy is not allowed
00047         WPXFileStream &operator=(const WPXFileStream &); // assignment is not allowed
00048 };
00049 
00050 class WPXStringStreamPrivate;
00051 
00052 class WPXStringStream: public WPXInputStream
00053 {
00054 public:
00055         WPXStringStream(const unsigned char *data, const unsigned int dataSize);
00056         ~WPXStringStream();
00057 
00058         const unsigned char *read(unsigned long numBytes, unsigned long &numBytesRead);
00059         long tell();
00060         int seek(long offset, WPX_SEEK_TYPE seekType);
00061         bool atEOS();
00062 
00063         bool isOLEStream();
00064         WPXInputStream *getDocumentOLEStream(const char *name);
00065 
00066 private:
00067         WPXStringStreamPrivate *d;
00068         WPXStringStream(const WPXStringStream &); // copy is not allowed
00069         WPXStringStream &operator=(const WPXStringStream &); // assignment is not allowed
00070 };
00071 
00072 #endif // __WPXSTREAMIMPLEMENTATION_H__
00073 /* vim:set shiftwidth=4 softtabstop=4 noexpandtab: */