00001 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*- */ 00002 /* librevenge 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) 2004-2005 William Lachance (wrlach@gmail.com) 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 00020 #ifndef RVNGSTREAM_H 00021 #define RVNGSTREAM_H 00022 00023 namespace librevenge 00024 { 00025 00026 enum RVNG_SEEK_TYPE 00027 { 00028 RVNG_SEEK_CUR, 00029 RVNG_SEEK_SET, 00030 RVNG_SEEK_END 00031 }; 00032 00033 class RVNGInputStream 00034 { 00035 public: 00036 RVNGInputStream() {} 00037 virtual ~RVNGInputStream() {} 00038 00044 virtual bool isStructured() = 0; 00045 00046 virtual unsigned subStreamCount() = 0; 00047 00048 virtual const char *subStreamName(unsigned id) = 0; 00049 00050 virtual bool existsSubStream(const char *name) = 0; 00051 00058 virtual RVNGInputStream *getSubStreamByName(const char *name) = 0; 00059 00060 virtual RVNGInputStream *getSubStreamById(unsigned id) = 0; 00061 00069 virtual const unsigned char *read(unsigned long numBytes, unsigned long &numBytesRead) = 0; 00070 00081 virtual int seek(long offset, RVNG_SEEK_TYPE seekType) = 0; 00082 00087 virtual long tell() = 0; 00088 00094 virtual bool isEnd() = 0; 00095 }; 00096 00097 } 00098 00099 #endif 00100 /* vim:set shiftwidth=4 softtabstop=4 noexpandtab: */