00001 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*- */ 00002 /* libwpd 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) 2006 Ariya Hidayat (ariya@kde.org) 00011 * 00012 * For minor contributions see the git repository. 00013 * 00014 * Alternatively, the contents of this file may be used under the terms 00015 * of the GNU Lesser General Public License Version 2.1 or later 00016 * (LGPLv2.1+), in which case the provisions of the LGPLv2.1+ are 00017 * applicable instead of those above. 00018 * 00019 * For further information visit http://libwpd.sourceforge.net 00020 */ 00021 00022 #ifndef __WPXSTREAMIMPLEMENTATION_H__ 00023 #define __WPXSTREAMIMPLEMENTATION_H__ 00024 00025 #include "WPXStream.h" 00026 00027 class WPXFileStreamPrivate; 00028 00029 class WPXFileStream: public WPXInputStream 00030 { 00031 public: 00032 explicit WPXFileStream(const char *filename); 00033 ~WPXFileStream(); 00034 00035 const unsigned char *read(unsigned long numBytes, unsigned long &numBytesRead); 00036 long tell(); 00037 int seek(long offset, WPX_SEEK_TYPE seekType); 00038 bool atEOS(); 00039 00040 bool isOLEStream(); 00041 WPXInputStream *getDocumentOLEStream(const char *name); 00042 00043 private: 00044 WPXFileStreamPrivate *d; 00045 WPXFileStream(const WPXFileStream &); // copy is not allowed 00046 WPXFileStream &operator=(const WPXFileStream &); // assignment is not allowed 00047 }; 00048 00049 class WPXStringStreamPrivate; 00050 00051 class WPXStringStream: public WPXInputStream 00052 { 00053 public: 00054 WPXStringStream(const unsigned char *data, const unsigned int dataSize); 00055 ~WPXStringStream(); 00056 00057 const unsigned char *read(unsigned long numBytes, unsigned long &numBytesRead); 00058 long tell(); 00059 int seek(long offset, WPX_SEEK_TYPE seekType); 00060 bool atEOS(); 00061 00062 bool isOLEStream(); 00063 WPXInputStream *getDocumentOLEStream(const char *name); 00064 00065 private: 00066 WPXStringStreamPrivate *d; 00067 WPXStringStream(const WPXStringStream &); // copy is not allowed 00068 WPXStringStream &operator=(const WPXStringStream &); // assignment is not allowed 00069 }; 00070 00071 #endif // __WPXSTREAMIMPLEMENTATION_H__ 00072 /* vim:set shiftwidth=4 softtabstop=4 noexpandtab: */