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 <librevenge-stream/librevenge-stream.h>
31
33
39class WPSStringStream: public librevenge::RVNGInputStream
40{
41public:
43 WPSStringStream(const unsigned char *data, const unsigned int dataSize);
46
48 void append(const unsigned char *data, const unsigned int dataSize);
53 const unsigned char *read(unsigned long numBytes, unsigned long &numBytesRead);
55 long tell();
59 int seek(long offset, librevenge::RVNG_SEEK_TYPE seekType);
61 bool isEnd();
62
66 bool isStructured();
70 unsigned subStreamCount();
74 const char *subStreamName(unsigned);
78 bool existsSubStream(const char *name);
82 librevenge::RVNGInputStream *getSubStreamByName(const char *name);
86 librevenge::RVNGInputStream *getSubStreamById(unsigned);
87
88private:
91 WPSStringStream(const WPSStringStream &); // copy is not allowed
92 WPSStringStream &operator=(const WPSStringStream &); // assignment is not allowed
93};
94
95#endif
96
97/* vim:set shiftwidth=4 softtabstop=4 noexpandtab: */
internal data of a WPSStringStream
Definition WPSStringStream.cpp:35
internal class used to create a RVNGInputStream from a unsigned char's pointer
Definition WPSStringStream.h:40
WPSStringStream & operator=(const WPSStringStream &)
bool isEnd()
returns true if we are at the end of the section/file
Definition WPSStringStream.cpp:146
librevenge::RVNGInputStream * getSubStreamById(unsigned)
return a new stream for a ole zone
Definition WPSStringStream.cpp:174
const char * subStreamName(unsigned)
returns the ith sub streams name
Definition WPSStringStream.cpp:164
int seek(long offset, librevenge::RVNG_SEEK_TYPE seekType)
seeks to a offset position, from actual, beginning or ending position
Definition WPSStringStream.cpp:122
~WPSStringStream()
destructor
Definition WPSStringStream.cpp:81
unsigned subStreamCount()
returns the number of sub streams.
Definition WPSStringStream.cpp:159
const unsigned char * read(unsigned long numBytes, unsigned long &numBytesRead)
! reads numbytes data.
Definition WPSStringStream.cpp:91
WPSStringStreamPrivate * m_data
the string stream data
Definition WPSStringStream.h:90
void append(const unsigned char *data, const unsigned int dataSize)
append some data at the end of the string
Definition WPSStringStream.cpp:86
WPSStringStream(const WPSStringStream &)
bool isStructured()
returns true if the stream is ole
Definition WPSStringStream.cpp:154
long tell()
returns actual offset position
Definition WPSStringStream.cpp:117
librevenge::RVNGInputStream * getSubStreamByName(const char *name)
return a new stream for a ole zone
Definition WPSStringStream.cpp:179
bool existsSubStream(const char *name)
returns true if a substream with name exists
Definition WPSStringStream.cpp:169

Generated on Wed Nov 29 2023 19:00:10 for libwps by doxygen 1.9.8