STOFFStringStream.hxx
Go to the documentation of this file.
/* -*- Mode: C++; c-default-style: "k&r"; indent-tabs-mode: nil; tab-width: 2; c-basic-offset: 2 -*- */
/* libstaroffice
* Version: MPL 2.0 / LGPLv2+
*
* The contents of this file are subject to the Mozilla Public License Version
* 2.0 (the "License"); you may not use this file except in compliance with
* the License or as specified alternatively below. You may obtain a copy of
* the License at http://www.mozilla.org/MPL/
*
* Software distributed under the License is distributed on an "AS IS" basis,
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
* for the specific language governing rights and limitations under the
* License.
*
* Alternatively, the contents of this file may be used under the terms of
* the GNU Lesser General Public License Version 2 or later (the "LGPLv2+"),
* in which case the provisions of the LGPLv2+ are applicable
* instead of those above.
*/
#ifndef STOFF_STRING_STREAM_HXX
#define STOFF_STRING_STREAM_HXX
#include <memory>
#include <librevenge-stream/librevenge-stream.h>
class STOFFStringStreamPrivate;
class STOFFStringStream final: public librevenge::RVNGInputStream
{
public:
STOFFStringStream(const unsigned char *data, const unsigned int dataSize);
~STOFFStringStream() final;
void append(const unsigned char *data, const unsigned int dataSize);
const unsigned char *read(unsigned long numBytes, unsigned long &numBytesRead) final;
long tell() final;
int seek(long offset, librevenge::RVNG_SEEK_TYPE seekType) final;
bool isEnd() final;
bool isStructured() final;
unsigned subStreamCount() final;
const char *subStreamName(unsigned) final;
bool existsSubStream(const char *name) final;
librevenge::RVNGInputStream *getSubStreamByName(const char *name) final;
librevenge::RVNGInputStream *getSubStreamById(unsigned) final;
private:
std::unique_ptr<STOFFStringStreamPrivate> m_data;
STOFFStringStream(const STOFFStringStream &); // copy is not allowed
STOFFStringStream &operator=(const STOFFStringStream &); // assignment is not allowed
};
#endif
// vim: set filetype=cpp tabstop=2 shiftwidth=2 cindent autoindent smartindent noexpandtab:
STOFFStringStreamPrivate
internal data of a STOFFStringStream
Definition STOFFStringStream.cxx:31
STOFFStringStream::subStreamCount
unsigned subStreamCount() final
returns the number of sub streams.
Definition STOFFStringStream.cxx:149
STOFFStringStream::subStreamName
const char * subStreamName(unsigned) final
returns the ith sub streams name
Definition STOFFStringStream.cxx:154
STOFFStringStream::append
void append(const unsigned char *data, const unsigned int dataSize)
append some data at the end of the string
Definition STOFFStringStream.cxx:77
STOFFStringStream::STOFFStringStream
STOFFStringStream(const STOFFStringStream &)
STOFFStringStream::read
const unsigned char * read(unsigned long numBytes, unsigned long &numBytesRead) final
!
Definition STOFFStringStream.cxx:82
STOFFStringStream::getSubStreamByName
librevenge::RVNGInputStream * getSubStreamByName(const char *name) final
return a new stream for a ole zone
Definition STOFFStringStream.cxx:169
STOFFStringStream::isEnd
bool isEnd() final
returns true if we are at the end of the section/file
Definition STOFFStringStream.cxx:136
STOFFStringStream::isStructured
bool isStructured() final
returns true if the stream is ole
Definition STOFFStringStream.cxx:144
STOFFStringStream::existsSubStream
bool existsSubStream(const char *name) final
returns true if a substream with name exists
Definition STOFFStringStream.cxx:159
STOFFStringStream::m_data
std::unique_ptr< STOFFStringStreamPrivate > m_data
the string stream data
Definition STOFFStringStream.hxx:87
STOFFStringStream::operator=
STOFFStringStream & operator=(const STOFFStringStream &)
STOFFStringStream::seek
int seek(long offset, librevenge::RVNG_SEEK_TYPE seekType) final
seeks to a offset position, from actual, beginning or ending position
Definition STOFFStringStream.cxx:114
STOFFStringStream::tell
long tell() final
returns actual offset position
Definition STOFFStringStream.cxx:109
STOFFStringStream::getSubStreamById
librevenge::RVNGInputStream * getSubStreamById(unsigned) final
return a new stream for a ole zone
Definition STOFFStringStream.cxx:164
STOFFStringStream::~STOFFStringStream
~STOFFStringStream() final
destructor
Definition STOFFStringStream.cxx:73
STOFFStringStream::STOFFStringStream
STOFFStringStream(const unsigned char *data, const unsigned int dataSize)
constructor
Definition STOFFStringStream.cxx:67