STOFFStringStream.hxx
Go to the documentation of this file.
00001 /* -*- Mode: C++; c-default-style: "k&r"; indent-tabs-mode: nil; tab-width: 2; c-basic-offset: 2 -*- */
00002 
00003 /* libstaroffice
00004 * Version: MPL 2.0 / LGPLv2+
00005 *
00006 * The contents of this file are subject to the Mozilla Public License Version
00007 * 2.0 (the "License"); you may not use this file except in compliance with
00008 * the License or as specified alternatively below. You may obtain a copy of
00009 * the License at http://www.mozilla.org/MPL/
00010 *
00011 * Software distributed under the License is distributed on an "AS IS" basis,
00012 * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
00013 * for the specific language governing rights and limitations under the
00014 * License.
00015 *
00016 * Alternatively, the contents of this file may be used under the terms of
00017 * the GNU Lesser General Public License Version 2 or later (the "LGPLv2+"),
00018 * in which case the provisions of the LGPLv2+ are applicable
00019 * instead of those above.
00020 */
00021 
00022 #ifndef STOFF_STRING_STREAM_HXX
00023 #define STOFF_STRING_STREAM_HXX
00024 
00025 #include <librevenge-stream/librevenge-stream.h>
00026 
00027 class STOFFStringStreamPrivate;
00028 
00034 class STOFFStringStream: public librevenge::RVNGInputStream
00035 {
00036 public:
00038   STOFFStringStream(const unsigned char *data, const unsigned int dataSize);
00040   ~STOFFStringStream();
00041 
00043   void append(const unsigned char *data, const unsigned int dataSize);
00048   const unsigned char *read(unsigned long numBytes, unsigned long &numBytesRead);
00050   long tell();
00054   int seek(long offset, librevenge::RVNG_SEEK_TYPE seekType);
00056   bool isEnd();
00057 
00061   bool isStructured();
00065   unsigned subStreamCount();
00069   const char *subStreamName(unsigned);
00073   bool existsSubStream(const char *name);
00077   librevenge::RVNGInputStream *getSubStreamByName(const char *name);
00081   librevenge::RVNGInputStream *getSubStreamById(unsigned);
00082 
00083 private:
00085   STOFFStringStreamPrivate *m_data;
00086   STOFFStringStream(const STOFFStringStream &); // copy is not allowed
00087   STOFFStringStream &operator=(const STOFFStringStream &); // assignment is not allowed
00088 };
00089 
00090 #endif
00091 
00092 // vim: set filetype=cpp tabstop=2 shiftwidth=2 cindent autoindent smartindent noexpandtab: