WPSStringStream.h
Go to the documentation of this file.
1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*- */
2 
3 /* libwps
4  * Version: MPL 2.0 / LGPLv2.1+
5  *
6  * This Source Code Form is subject to the terms of the Mozilla Public
7  * License, v. 2.0. If a copy of the MPL was not distributed with this
8  * file, You can obtain one at http://mozilla.org/MPL/2.0/.
9  *
10  * Major Contributor(s):
11  * Copyright (C) 2009, 2011 Alonso Laurent (alonso@loria.fr)
12  * Copyright (C) 2006, 2007 Andrew Ziem
13  * Copyright (C) 2004-2006 Fridrich Strba (fridrich.strba@bluewin.ch)
14  * Copyright (C) 2004 Marc Maurer (uwog@uwog.net)
15  * Copyright (C) 2003-2005 William Lachance (william.lachance@sympatico.ca)
16  *
17  * For minor contributions see the git repository.
18  *
19  * Alternatively, the contents of this file may be used under the terms
20  * of the GNU Lesser General Public License Version 2.1 or later
21  * (LGPLv2.1+), in which case the provisions of the LGPLv2.1+ are
22  * applicable instead of those above.
23  *
24  * For further information visit http://libwps.sourceforge.net
25  */
26 
27 #ifndef WPS_STRING_STREAM_H
28 #define WPS_STRING_STREAM_H
29 
30 #include <memory>
31 
32 #include <librevenge-stream/librevenge-stream.h>
33 
35 
41 class WPSStringStream final: public librevenge::RVNGInputStream
42 {
43 public:
45  WPSStringStream(const unsigned char *data, const unsigned int dataSize);
47  ~WPSStringStream() final;
48 
50  void append(const unsigned char *data, const unsigned int dataSize);
55  const unsigned char *read(unsigned long numBytes, unsigned long &numBytesRead) final;
57  long tell() final;
61  int seek(long offset, librevenge::RVNG_SEEK_TYPE seekType) final;
63  bool isEnd() final;
64 
68  bool isStructured() final;
72  unsigned subStreamCount() final;
76  const char *subStreamName(unsigned) final;
80  bool existsSubStream(const char *name) final;
84  librevenge::RVNGInputStream *getSubStreamByName(const char *name) final;
88  librevenge::RVNGInputStream *getSubStreamById(unsigned) final;
89 
90 private:
92  std::unique_ptr<WPSStringStreamPrivate> m_data;
93  WPSStringStream(const WPSStringStream &) = delete; // copy is not allowed
94  WPSStringStream &operator=(const WPSStringStream &) = delete; // assignment is not allowed
95 };
96 
97 #endif
98 
99 /* vim:set shiftwidth=4 softtabstop=4 noexpandtab: */
long tell() final
returns actual offset position
Definition: WPSStringStream.cpp:116
const char * subStreamName(unsigned) final
returns the ith sub streams name
Definition: WPSStringStream.cpp:163
~WPSStringStream() final
destructor
Definition: WPSStringStream.cpp:81
WPSStringStream & operator=(const WPSStringStream &)=delete
librevenge::RVNGInputStream * getSubStreamByName(const char *name) final
return a new stream for a ole zone
Definition: WPSStringStream.cpp:178
unsigned subStreamCount() final
returns the number of sub streams.
Definition: WPSStringStream.cpp:158
internal class used to create a RVNGInputStream from a unsigned char&#39;s pointer
Definition: WPSStringStream.h:41
bool isEnd() final
returns true if we are at the end of the section/file
Definition: WPSStringStream.cpp:145
const unsigned char * read(unsigned long numBytes, unsigned long &numBytesRead) final
! reads numbytes data.
Definition: WPSStringStream.cpp:90
void append(const unsigned char *data, const unsigned int dataSize)
append some data at the end of the string
Definition: WPSStringStream.cpp:85
WPSStringStream(const unsigned char *data, const unsigned int dataSize)
constructor
Definition: WPSStringStream.cpp:75
bool existsSubStream(const char *name) final
returns true if a substream with name exists
Definition: WPSStringStream.cpp:168
std::string name(long id)
returns the name given Windows© id
Definition: libwps_tools_win.cpp:7299
bool isStructured() final
returns true if the stream is ole
Definition: WPSStringStream.cpp:153
std::unique_ptr< WPSStringStreamPrivate > m_data
the string stream data
Definition: WPSStringStream.h:92
int seek(long offset, librevenge::RVNG_SEEK_TYPE seekType) final
seeks to a offset position, from actual, beginning or ending position
Definition: WPSStringStream.cpp:121
internal data of a WPSStringStream
Definition: WPSStringStream.cpp:34
librevenge::RVNGInputStream * getSubStreamById(unsigned) final
return a new stream for a ole zone
Definition: WPSStringStream.cpp:173

Generated on Fri May 27 2022 03:07:00 for libwps by doxygen 1.8.14