MWAWStringStream.hxx
Go to the documentation of this file.
1 /* -*- Mode: C++; c-default-style: "k&r"; indent-tabs-mode: nil; tab-width: 2; c-basic-offset: 2 -*- */
2 
3 /* libmwaw
4 * Version: MPL 2.0 / LGPLv2+
5 *
6 * The contents of this file are subject to the Mozilla Public License Version
7 * 2.0 (the "License"); you may not use this file except in compliance with
8 * the License or as specified alternatively below. You may obtain a copy of
9 * the License at http://www.mozilla.org/MPL/
10 *
11 * Software distributed under the License is distributed on an "AS IS" basis,
12 * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
13 * for the specific language governing rights and limitations under the
14 * License.
15 *
16 * Alternatively, the contents of this file may be used under the terms of
17 * the GNU Lesser General Public License Version 2 or later (the "LGPLv2+"),
18 * in which case the provisions of the LGPLv2+ are applicable
19 * instead of those above.
20 */
21 
22 #ifndef MWAW_STRING_STREAM_HXX
23 #define MWAW_STRING_STREAM_HXX
24 
25 #include <librevenge-stream/librevenge-stream.h>
26 
28 
34 class MWAWStringStream: public librevenge::RVNGInputStream
35 {
36 public:
38  MWAWStringStream(const unsigned char *data, const unsigned int dataSize);
41 
43  void append(const unsigned char *data, const unsigned int dataSize);
48  const unsigned char *read(unsigned long numBytes, unsigned long &numBytesRead);
50  long tell();
54  int seek(long offset, librevenge::RVNG_SEEK_TYPE seekType);
56  bool isEnd();
57 
61  bool isStructured();
65  unsigned subStreamCount();
69  const char *subStreamName(unsigned);
73  bool existsSubStream(const char *name);
77  librevenge::RVNGInputStream *getSubStreamByName(const char *name);
81  librevenge::RVNGInputStream *getSubStreamById(unsigned);
82 
83 private:
86  MWAWStringStream(const MWAWStringStream &); // copy is not allowed
87  MWAWStringStream &operator=(const MWAWStringStream &); // assignment is not allowed
88 };
89 
90 #endif
91 
92 // vim: set filetype=cpp tabstop=2 shiftwidth=2 cindent autoindent smartindent noexpandtab:
MWAWStringStream::getSubStreamById
librevenge::RVNGInputStream * getSubStreamById(unsigned)
return a new stream for a ole zone
Definition: MWAWStringStream.cxx:167
MWAWStringStreamPrivate
internal data of a MWAWStringStream
Definition: MWAWStringStream.cxx:31
MWAWStringStreamPrivate::m_buffer
std::vector< unsigned char > m_buffer
the stream buffer
Definition: MWAWStringStream.cxx:40
MWAWStringStream::m_data
MWAWStringStreamPrivate * m_data
the string stream data
Definition: MWAWStringStream.hxx:85
MWAWStringStreamPrivate::append
void append(const unsigned char *data, unsigned dataSize)
append some data at the end of the actual stream
Definition: MWAWStringStream.cxx:62
MWAWStringStream::read
const unsigned char * read(unsigned long numBytes, unsigned long &numBytesRead)
! reads numbytes data.
Definition: MWAWStringStream.cxx:86
MWAWStringStream::tell
long tell()
returns actual offset position
Definition: MWAWStringStream.cxx:112
MWAWStringStream::existsSubStream
bool existsSubStream(const char *name)
returns true if a substream with name exists
Definition: MWAWStringStream.cxx:162
MWAWStringStream::MWAWStringStream
MWAWStringStream(const MWAWStringStream &)
MWAWStringStream::getSubStreamByName
librevenge::RVNGInputStream * getSubStreamByName(const char *name)
return a new stream for a ole zone
Definition: MWAWStringStream.cxx:172
MWAWStringStream::operator=
MWAWStringStream & operator=(const MWAWStringStream &)
MWAWStringStreamPrivate::MWAWStringStreamPrivate
MWAWStringStreamPrivate(const unsigned char *data, unsigned dataSize)
constructor
Definition: MWAWStringStream.cxx:48
MWAWStringStreamPrivate::operator=
MWAWStringStreamPrivate & operator=(const MWAWStringStreamPrivate &)
MWAWStringStream::isStructured
bool isStructured()
returns true if the stream is ole
Definition: MWAWStringStream.cxx:147
MWAWStringStream::subStreamCount
unsigned subStreamCount()
returns the number of sub streams.
Definition: MWAWStringStream.cxx:152
MWAWStringStream::MWAWStringStream
MWAWStringStream(const unsigned char *data, const unsigned int dataSize)
constructor
Definition: MWAWStringStream.cxx:70
MWAWStringStreamPrivate::m_offset
long m_offset
the stream offset
Definition: MWAWStringStream.cxx:42
MWAWStringStream::append
void append(const unsigned char *data, const unsigned int dataSize)
append some data at the end of the string
Definition: MWAWStringStream.cxx:81
MWAWStringStream::~MWAWStringStream
~MWAWStringStream()
destructor
Definition: MWAWStringStream.cxx:76
MWAWStringStream.hxx
librevenge
Definition: MWAWDocument.hxx:57
MWAWStringStream::seek
int seek(long offset, librevenge::RVNG_SEEK_TYPE seekType)
seeks to a offset position, from actual, beginning or ending position
Definition: MWAWStringStream.cxx:117
MWAWStringStream::subStreamName
const char * subStreamName(unsigned)
returns the ith sub streams name
Definition: MWAWStringStream.cxx:157
MWAWStringStream::isEnd
bool isEnd()
returns true if we are at the end of the section/file
Definition: MWAWStringStream.cxx:139
MWAWStringStreamPrivate::~MWAWStringStreamPrivate
~MWAWStringStreamPrivate()
destructor
Definition: MWAWStringStream.cxx:58
MWAWStringStreamPrivate::MWAWStringStreamPrivate
MWAWStringStreamPrivate(const MWAWStringStreamPrivate &)
MWAWStringStream
internal class used to create a RVNGInputStream from a unsigned char's pointer
Definition: MWAWStringStream.hxx:35

Generated on Wed Jun 17 2020 06:30:12 for libmwaw by doxygen 1.8.18