MWAWStringStream.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 -*- */
/* libmwaw
* 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 MWAW_STRING_STREAM_HXX
#define MWAW_STRING_STREAM_HXX
#include <memory>
#include <librevenge-stream/librevenge-stream.h>
class MWAWStringStreamPrivate;
class MWAWStringStream final : public librevenge::RVNGInputStream
{
public:
MWAWStringStream(const unsigned char *data, const unsigned int dataSize);
~MWAWStringStream() final;
void append(const unsigned char *data, const unsigned int dataSize);
void resize(unsigned long newSize);
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::shared_ptr<MWAWStringStreamPrivate> m_data;
MWAWStringStream(const MWAWStringStream &) = delete; // copy is not allowed
MWAWStringStream &operator=(const MWAWStringStream &) = delete; // assignment is not allowed
};
#endif
// vim: set filetype=cpp tabstop=2 shiftwidth=2 cindent autoindent smartindent noexpandtab:
MWAWStringStreamPrivate
internal data of a MWAWStringStream
Definition MWAWStringStream.cxx:31
MWAWStringStream::subStreamName
const char * subStreamName(unsigned) final
returns the ith sub streams name
Definition MWAWStringStream.cxx:168
MWAWStringStream::existsSubStream
bool existsSubStream(const char *name) final
returns true if a substream with name exists
Definition MWAWStringStream.cxx:173
MWAWStringStream::getSubStreamByName
librevenge::RVNGInputStream * getSubStreamByName(const char *name) final
return a new stream for a ole zone
Definition MWAWStringStream.cxx:183
MWAWStringStream::tell
long tell() final
returns actual offset position
Definition MWAWStringStream.cxx:123
MWAWStringStream::append
void append(const unsigned char *data, const unsigned int dataSize)
append some data at the end of the string
Definition MWAWStringStream.cxx:87
MWAWStringStream::isStructured
bool isStructured() final
returns true if the stream is ole
Definition MWAWStringStream.cxx:158
MWAWStringStream::resize
void resize(unsigned long newSize)
resize the buffer stream (very low level)
Definition MWAWStringStream.cxx:92
MWAWStringStream::m_data
std::shared_ptr< MWAWStringStreamPrivate > m_data
the string stream data
Definition MWAWStringStream.hxx:90
MWAWStringStream::MWAWStringStream
MWAWStringStream(const MWAWStringStream &)=delete
MWAWStringStream::MWAWStringStream
MWAWStringStream(const unsigned char *data, const unsigned int dataSize)
constructor
Definition MWAWStringStream.cxx:77
MWAWStringStream::read
const unsigned char * read(unsigned long numBytes, unsigned long &numBytesRead) final
!
Definition MWAWStringStream.cxx:97
MWAWStringStream::operator=
MWAWStringStream & operator=(const MWAWStringStream &)=delete
MWAWStringStream::seek
int seek(long offset, librevenge::RVNG_SEEK_TYPE seekType) final
seeks to a offset position, from actual, beginning or ending position
Definition MWAWStringStream.cxx:128
MWAWStringStream::subStreamCount
unsigned subStreamCount() final
returns the number of sub streams.
Definition MWAWStringStream.cxx:163
MWAWStringStream::isEnd
bool isEnd() final
returns true if we are at the end of the section/file
Definition MWAWStringStream.cxx:150
MWAWStringStream::~MWAWStringStream
~MWAWStringStream() final
destructor
Definition MWAWStringStream.cxx:83
MWAWStringStream::getSubStreamById
librevenge::RVNGInputStream * getSubStreamById(unsigned) final
return a new stream for a ole zone
Definition MWAWStringStream.cxx:178