WPSStringStream.h Source File documentation

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
32 class WPSStringStreamPrivate;
33
39 class WPSStringStream: public librevenge::RVNGInputStream
40 {
41 public:
43 WPSStringStream(const unsigned char *data, const unsigned int dataSize);
45 ~WPSStringStream();
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
88 private:
90 WPSStringStreamPrivate *m_data;
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: */
WPSStringStream::m_data
WPSStringStreamPrivate * m_data
the string stream data
Definition: WPSStringStream.h:90
WPSStringStream::isStructured
bool isStructured()
returns true if the stream is ole
Definition: WPSStringStream.cpp:154
WPSStringStream::seek
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
internal class used to create a RVNGInputStream from a unsigned char&#39;s pointer
Definition: WPSStringStream.h:39
WPSStringStream::operator=
WPSStringStream & operator=(const WPSStringStream &)
WPSStringStream::getSubStreamByName
librevenge::RVNGInputStream * getSubStreamByName(const char *name)
return a new stream for a ole zone
Definition: WPSStringStream.cpp:179
WPSStringStream::append
void append(const unsigned char *data, const unsigned int dataSize)
append some data at the end of the string
Definition: WPSStringStream.cpp:86
WPSStringStream::WPSStringStream
WPSStringStream(const unsigned char *data, const unsigned int dataSize)
constructor
Definition: WPSStringStream.cpp:75
WPSStringStream::existsSubStream
bool existsSubStream(const char *name)
returns true if a substream with name exists
Definition: WPSStringStream.cpp:169
libwps_tools_win::Language::name
std::string name(long id)
returns the name given Windows© id
Definition: libwps_tools_win.cpp:7296
WPSStringStream::~WPSStringStream
~WPSStringStream()
destructor
Definition: WPSStringStream.cpp:81
WPSStringStream::subStreamName
const char * subStreamName(unsigned)
returns the ith sub streams name
Definition: WPSStringStream.cpp:164
WPSStringStream::tell
long tell()
returns actual offset position
Definition: WPSStringStream.cpp:117
WPSStringStream::subStreamCount
unsigned subStreamCount()
returns the number of sub streams.
Definition: WPSStringStream.cpp:159
WPSStringStreamPrivate
internal data of a WPSStringStream
Definition: WPSStringStream.cpp:34
WPSStringStream::read
const unsigned char * read(unsigned long numBytes, unsigned long &numBytesRead)
! reads numbytes data.
Definition: WPSStringStream.cpp:91
WPSStringStream::isEnd
bool isEnd()
returns true if we are at the end of the section/file
Definition: WPSStringStream.cpp:146
WPSStringStream::getSubStreamById
librevenge::RVNGInputStream * getSubStreamById(unsigned)
return a new stream for a ole zone
Definition: WPSStringStream.cpp:174