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 #include <librevenge-stream/librevenge-stream.h>
23 
25 
31 class MWAWStringStream: public librevenge::RVNGInputStream
32 {
33 public:
35  MWAWStringStream(const unsigned char *data, const unsigned int dataSize);
38 
40  void append(const unsigned char *data, const unsigned int dataSize);
45  const unsigned char *read(unsigned long numBytes, unsigned long &numBytesRead);
47  long tell();
51  int seek(long offset, librevenge::RVNG_SEEK_TYPE seekType);
53  bool isEnd();
54 
58  bool isStructured();
62  unsigned subStreamCount();
66  const char *subStreamName(unsigned);
70  bool existsSubStream(const char *name);
74  librevenge::RVNGInputStream *getSubStreamByName(const char *name);
78  librevenge::RVNGInputStream *getSubStreamById(unsigned);
79 
80 private:
82  MWAWStringStream(const MWAWStringStream &); // copy is not allowed
83  MWAWStringStream &operator=(const MWAWStringStream &); // assignment is not allowed
84 };
85 
86 // vim: set filetype=cpp tabstop=2 shiftwidth=2 cindent autoindent smartindent noexpandtab:
const char * subStreamName(unsigned)
returns the ith sub streams name
Definition: MWAWStringStream.cxx:147
Definition: MWAWStringStream.cxx:29
MWAWStringStreamPrivate * d
Definition: MWAWStringStream.hxx:81
bool existsSubStream(const char *name)
returns true if a substream with name exists
Definition: MWAWStringStream.cxx:152
const unsigned char * read(unsigned long numBytes, unsigned long &numBytesRead)
! reads numbytes data.
Definition: MWAWStringStream.cxx:77
void append(const unsigned char *data, const unsigned int dataSize)
append some data at the end of the string
Definition: MWAWStringStream.cxx:72
librevenge::RVNGInputStream * getSubStreamById(unsigned)
return a new stream for a ole zone
Definition: MWAWStringStream.cxx:157
librevenge::RVNGInputStream * getSubStreamByName(const char *name)
return a new stream for a ole zone
Definition: MWAWStringStream.cxx:162
MWAWStringStream & operator=(const MWAWStringStream &)
long tell()
returns actual offset position
Definition: MWAWStringStream.cxx:103
internal class used to create a RVNGInputStream from a unsigned char's pointer
Definition: MWAWStringStream.hxx:31
int seek(long offset, librevenge::RVNG_SEEK_TYPE seekType)
seeks to a offset position, from actual, beginning or ending position
Definition: MWAWStringStream.cxx:108
bool isStructured()
returns true if the stream is ole
Definition: MWAWStringStream.cxx:137
bool isEnd()
returns true if we are at the end of the section/file
Definition: MWAWStringStream.cxx:129
unsigned subStreamCount()
returns the number of sub streams.
Definition: MWAWStringStream.cxx:142
MWAWStringStream(const unsigned char *data, const unsigned int dataSize)
constructor
Definition: MWAWStringStream.cxx:61
~MWAWStringStream()
destructor
Definition: MWAWStringStream.cxx:67

Generated on Mon Apr 10 2017 17:36:54 for libmwaw by doxygen 1.8.8