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 <libwpd-stream/libwpd-stream.h>
17 
18 namespace libfreehand
19 {
20 
21 class FHInternalStream : public WPXInputStream
22 {
23 public:
24  FHInternalStream(WPXInputStream *input, unsigned long size, bool compressed=false);
26 
27  bool isOLEStream()
28  {
29  return false;
30  }
31  WPXInputStream *getDocumentOLEStream(const char *)
32  {
33  return 0;
34  }
35 
36  const unsigned char *read(unsigned long numBytes, unsigned long &numBytesRead);
37  int seek(long offset, WPX_SEEK_TYPE seekType);
38  long tell();
39  bool atEOS();
40  unsigned long getSize() const
41  {
42  return m_buffer.size();
43  }
44 
45 private:
46  volatile long m_offset;
47  std::vector<unsigned char> m_buffer;
50 };
51 
52 } // namespace libfreehand
53 
54 #endif
55 /* vim:set shiftwidth=2 softtabstop=2 expandtab: */
volatile long m_offset
Definition: FHInternalStream.h:46
~FHInternalStream()
Definition: FHInternalStream.h:25
FHInternalStream(WPXInputStream *input, unsigned long size, bool compressed=false)
Definition: FHInternalStream.cpp:19
Definition: FHInternalStream.h:21
unsigned long getSize() const
Definition: FHInternalStream.h:40
WPXInputStream * getDocumentOLEStream(const char *)
Definition: FHInternalStream.h:31
bool isOLEStream()
Definition: FHInternalStream.h:27
int seek(long offset, WPX_SEEK_TYPE seekType)
Definition: FHInternalStream.cpp:115
bool atEOS()
Definition: FHInternalStream.cpp:141
std::vector< unsigned char > m_buffer
Definition: FHInternalStream.h:47
FHInternalStream & operator=(const FHInternalStream &)
const unsigned char * read(unsigned long numBytes, unsigned long &numBytesRead)
Definition: FHInternalStream.cpp:90
long tell()
Definition: FHInternalStream.cpp:136

Generated for libfreehand by doxygen 1.8.5