STOFFStringStream.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 /* libstaroffice
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 STOFF_STRING_STREAM_HXX
23 #define STOFF_STRING_STREAM_HXX
24 
25 #include <memory>
26 
27 #include <librevenge-stream/librevenge-stream.h>
28 
30 
36 class STOFFStringStream final: public librevenge::RVNGInputStream
37 {
38 public:
40  STOFFStringStream(const unsigned char *data, const unsigned int dataSize);
42  ~STOFFStringStream() final;
43 
45  void append(const unsigned char *data, const unsigned int dataSize);
50  const unsigned char *read(unsigned long numBytes, unsigned long &numBytesRead) final;
52  long tell() final;
56  int seek(long offset, librevenge::RVNG_SEEK_TYPE seekType) final;
58  bool isEnd() final;
59 
63  bool isStructured() final;
67  unsigned subStreamCount() final;
71  const char *subStreamName(unsigned) final;
75  bool existsSubStream(const char *name) final;
79  librevenge::RVNGInputStream *getSubStreamByName(const char *name) final;
83  librevenge::RVNGInputStream *getSubStreamById(unsigned) final;
84 
85 private:
87  std::unique_ptr<STOFFStringStreamPrivate> m_data;
88  STOFFStringStream(const STOFFStringStream &); // copy is not allowed
89  STOFFStringStream &operator=(const STOFFStringStream &); // assignment is not allowed
90 };
91 
92 #endif
93 
94 // vim: set filetype=cpp tabstop=2 shiftwidth=2 cindent autoindent smartindent noexpandtab:
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
STOFFStringStreamPrivate
internal data of a STOFFStringStream
Definition: STOFFStringStream.cxx:30
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:113
STOFFStringStreamPrivate::append
void append(const unsigned char *data, unsigned dataSize)
append some data at the end of the actual stream
Definition: STOFFStringStream.cxx:59
STOFFStringStream::getSubStreamById
librevenge::RVNGInputStream * getSubStreamById(unsigned) final
return a new stream for a ole zone
Definition: STOFFStringStream.cxx:163
STOFFStringStreamPrivate::~STOFFStringStreamPrivate
~STOFFStringStreamPrivate()
destructor
Definition: STOFFStringStream.cxx:55
STOFFStringStream::existsSubStream
bool existsSubStream(const char *name) final
returns true if a substream with name exists
Definition: STOFFStringStream.cxx:158
STOFFStringStream::read
const unsigned char * read(unsigned long numBytes, unsigned long &numBytesRead) final
! reads numbytes data.
Definition: STOFFStringStream.cxx:82
STOFFStringStreamPrivate::STOFFStringStreamPrivate
STOFFStringStreamPrivate(const unsigned char *data, unsigned dataSize)
constructor
Definition: STOFFStringStream.cxx:48
STOFFStringStream::isStructured
bool isStructured() final
returns true if the stream is ole
Definition: STOFFStringStream.cxx:143
STOFFStringStream::STOFFStringStream
STOFFStringStream(const unsigned char *data, const unsigned int dataSize)
constructor
Definition: STOFFStringStream.cxx:67
STOFFStringStream::operator=
STOFFStringStream & operator=(const STOFFStringStream &)
STOFFStringStreamPrivate::m_offset
long m_offset
the stream offset
Definition: STOFFStringStream.cxx:42
STOFFStringStream::getSubStreamByName
librevenge::RVNGInputStream * getSubStreamByName(const char *name) final
return a new stream for a ole zone
Definition: STOFFStringStream.cxx:168
STOFFStringStream::subStreamCount
unsigned subStreamCount() final
returns the number of sub streams.
Definition: STOFFStringStream.cxx:148
STOFFStringStreamPrivate::operator=
STOFFStringStreamPrivate & operator=(const STOFFStringStreamPrivate &)
STOFFStringStream.hxx
STOFFStringStream::isEnd
bool isEnd() final
returns true if we are at the end of the section/file
Definition: STOFFStringStream.cxx:135
STOFFStringStream::~STOFFStringStream
~STOFFStringStream() final
destructor
Definition: STOFFStringStream.cxx:73
librevenge
Definition: STOFFDocument.hxx:42
STOFFStringStreamPrivate::m_buffer
std::vector< unsigned char > m_buffer
the stream buffer
Definition: STOFFStringStream.cxx:40
STOFFStringStream
internal class used to create a RVNGInputStream from a unsigned char's pointer
Definition: STOFFStringStream.hxx:36
STOFFStringStream::subStreamName
const char * subStreamName(unsigned) final
returns the ith sub streams name
Definition: STOFFStringStream.cxx:153
STOFFStringStream::m_data
std::unique_ptr< STOFFStringStreamPrivate > m_data
the string stream data
Definition: STOFFStringStream.hxx:87
STOFFStringStream::tell
long tell() final
returns actual offset position
Definition: STOFFStringStream.cxx:108

Generated on Mon Jan 20 2020 23:02:18 for libstaroffice by doxygen 1.8.16