RVNGDirectoryStream.h
Go to the documentation of this file.
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) 2002-2005 William Lachance (wrlach@gmail.com)
00011  * Copyright (C) 2002 Marc Maurer (uwog@uwog.net)
00012  * Copyright (C) 2006 Fridrich Strba (fridrich.strba@bluewin.ch)
00013  *
00014  * For minor contributions see the git repository.
00015  *
00016  * Alternatively, the contents of this file may be used under the terms
00017  * of the GNU Lesser General Public License Version 2.1 or later
00018  * (LGPLv2.1+), in which case the provisions of the LGPLv2.1+ are
00019  * applicable instead of those above.
00020  */
00021 
00022 #ifndef RVNGDIRECTORYSTREAM_H_INCLUDED
00023 #define RVNGDIRECTORYSTREAM_H_INCLUDED
00024 
00025 #include "librevenge-stream-api.h"
00026 
00027 #include "RVNGStream.h"
00028 
00029 namespace librevenge
00030 {
00031 
00032 struct RVNGDirectoryStreamImpl;
00033 
00040 class REVENGE_STREAM_API RVNGDirectoryStream : public RVNGInputStream
00041 {
00042         // disable copying
00043         RVNGDirectoryStream(const RVNGDirectoryStream &);
00044         RVNGDirectoryStream &operator=(const RVNGDirectoryStream &);
00045 
00046 public:
00052         explicit RVNGDirectoryStream(const char *path);
00053 
00054         virtual ~RVNGDirectoryStream();
00055 
00063         static RVNGDirectoryStream *createForParent(const char *path);
00064 
00069         static bool isDirectory(const char *path);
00070 
00071         virtual bool isStructured();
00072         virtual unsigned subStreamCount();
00073         virtual const char *subStreamName(unsigned id);
00074         virtual bool existsSubStream(const char *name);
00075         virtual RVNGInputStream *getSubStreamByName(const char *name);
00076         virtual RVNGInputStream *getSubStreamById(unsigned id);
00077 
00078         virtual const unsigned char *read(unsigned long numBytes, unsigned long &numBytesRead);
00079         virtual int seek(long offset, RVNG_SEEK_TYPE seekType);
00080         virtual long tell();
00081         virtual bool isEnd();
00082 
00083 private:
00084         RVNGDirectoryStreamImpl *m_impl;
00085 };
00086 
00087 }
00088 
00089 #endif //  RVNGDIRECTORYSTREAM_H_INCLUDED
00090 
00091 /* vim:set shiftwidth=4 softtabstop=4 noexpandtab: */