FHInternalStream.h Source File documentation

- Main Page
- Namespaces
- Classes
- Files

- File List
- File Members

FHInternalStream.h
Go to the documentation of this file.
1 /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
2 /*
3 * This file is part of the libfreehand project.
4 *
5 * This Source Code Form is subject to the terms of the Mozilla Public
6 * License, v. 2.0. If a copy of the MPL was not distributed with this
7 * file, You can obtain one at http://mozilla.org/MPL/2.0/.
8 */
9
10
11 #ifndef __FHINTERNALSTREAM_H__
12 #define __FHINTERNALSTREAM_H__
13
14 #include <vector>
15
16 #include <librevenge-stream/librevenge-stream.h>
17
18 namespace libfreehand
19 {
20
21 class FHInternalStream : public librevenge::RVNGInputStream
22 {
23 public:
24 FHInternalStream(librevenge::RVNGInputStream *input, unsigned long size, bool compressed=false);
25 ~FHInternalStream() {}
26 virtual bool isStructured()
27 {
28 return false;
29 }
30 virtual unsigned subStreamCount()
31 {
32 return 0;
33 }
34 virtual const char *subStreamName(unsigned)
35 {
36 return 0;
37 }
38 virtual bool existsSubStream(const char *)
39 {
40 return false;
41 }
42 virtual librevenge::RVNGInputStream *getSubStreamByName(const char *)
43 {
44 return 0;
45 }
46 virtual librevenge::RVNGInputStream *getSubStreamById(unsigned)
47 {
48 return 0;
49 }
50 const unsigned char *read(unsigned long numBytes, unsigned long &numBytesRead);
51 int seek(long offset, librevenge::RVNG_SEEK_TYPE seekType);
52 long tell();
53 bool isEnd();
54 unsigned long getSize() const
55 {
56 return m_buffer.size();
57 }
58
59 private:
60 volatile long m_offset;
61 std::vector<unsigned char> m_buffer;
62 FHInternalStream(const FHInternalStream &);
63 FHInternalStream &operator=(const FHInternalStream &);
64 };
65
66 } // namespace libfreehand
67
68 #endif
69 /* vim:set shiftwidth=2 softtabstop=2 expandtab: */
libfreehand::FHInternalStream::subStreamName
virtual const char * subStreamName(unsigned)
Definition: FHInternalStream.h:34
libfreehand::FHInternalStream::m_offset
volatile long m_offset
Definition: FHInternalStream.h:60
libfreehand::FHInternalStream::~FHInternalStream
~FHInternalStream()
Definition: FHInternalStream.h:25
libfreehand
Definition: FHCollector.h:21
libfreehand::FHInternalStream::subStreamCount
virtual unsigned subStreamCount()
Definition: FHInternalStream.h:30
libfreehand::FHInternalStream
Definition: FHInternalStream.h:21
libfreehand::FHInternalStream::getSubStreamByName
virtual librevenge::RVNGInputStream * getSubStreamByName(const char *)
Definition: FHInternalStream.h:42
libfreehand::FHInternalStream::isStructured
virtual bool isStructured()
Definition: FHInternalStream.h:26
libfreehand::FHInternalStream::getSize
unsigned long getSize() const
Definition: FHInternalStream.h:54
libfreehand::FHInternalStream::existsSubStream
virtual bool existsSubStream(const char *)
Definition: FHInternalStream.h:38
libfreehand::FHInternalStream::FHInternalStream
FHInternalStream(librevenge::RVNGInputStream *input, unsigned long size, bool compressed=false)
Definition: FHInternalStream.cpp:19
libfreehand::FHInternalStream::isEnd
bool isEnd()
Definition: FHInternalStream.cpp:144
libfreehand::FHInternalStream::seek
int seek(long offset, librevenge::RVNG_SEEK_TYPE seekType)
Definition: FHInternalStream.cpp:118
libfreehand::FHInternalStream::getSubStreamById
virtual librevenge::RVNGInputStream * getSubStreamById(unsigned)
Definition: FHInternalStream.h:46
libfreehand::FHInternalStream::m_buffer
std::vector< unsigned char > m_buffer
Definition: FHInternalStream.h:61
libfreehand::FHInternalStream::operator=
FHInternalStream & operator=(const FHInternalStream &)
libfreehand::FHInternalStream::read
const unsigned char * read(unsigned long numBytes, unsigned long &numBytesRead)
Definition: FHInternalStream.cpp:93
libfreehand::FHInternalStream::tell
long tell()
Definition: FHInternalStream.cpp:139