KEYMemoryStream.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 libetonyek 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 #ifndef KEYMEMORYSTREAM_H_INCLUDED
11 #define KEYMEMORYSTREAM_H_INCLUDED
12 
13 #include <vector>
14 
15 #include "libetonyek_utils.h"
16 
17 namespace libetonyek
18 {
19 
20 class KEYMemoryStream : public WPXInputStream
21 {
22  // -Weffc++
23  KEYMemoryStream(const KEYMemoryStream &other);
25 
26 public:
27  explicit KEYMemoryStream(const WPXInputStreamPtr_t &input);
28  KEYMemoryStream(const WPXInputStreamPtr_t &input, unsigned length);
29  explicit KEYMemoryStream(std::vector<unsigned char> &data);
30  KEYMemoryStream(const unsigned char *data, unsigned length);
31  virtual ~KEYMemoryStream();
32 
33  virtual bool isOLEStream();
34  virtual WPXInputStream *getDocumentOLEStream(const char *name);
35 
36  virtual const unsigned char *read(unsigned long numBytes, unsigned long &numBytesRead);
37  virtual int seek(long offset, WPX_SEEK_TYPE seekType);
38  virtual long tell();
39  virtual bool atEOS();
40 
41 private:
42  void assign(const unsigned char *data, unsigned length);
43  void read(const WPXInputStreamPtr_t &input, unsigned length);
44 
45 private:
46  const unsigned char *m_data;
47  long m_length;
48  long m_pos;
49 };
50 
51 }
52 
53 #endif // KEYMEMORYSTREAM_H_INCLUDED
54 
55 /* vim:set shiftwidth=2 softtabstop=2 expandtab: */
Definition: KEY1Token.h:139
virtual WPXInputStream * getDocumentOLEStream(const char *name)
Definition: KEYMemoryStream.cpp:72
const char * name
Definition: KEY1Token.cpp:43
KEYMemoryStream & operator=(const KEYMemoryStream &other)
virtual ~KEYMemoryStream()
Definition: KEYMemoryStream.cpp:62
long m_length
Definition: KEYMemoryStream.h:47
virtual int seek(long offset, WPX_SEEK_TYPE seekType)
Definition: KEYMemoryStream.cpp:98
Definition: KEYMemoryStream.h:20
virtual bool isOLEStream()
Definition: KEYMemoryStream.cpp:67
Definition: KEY2Token.h:1014
long m_pos
Definition: KEYMemoryStream.h:48
Definition: KEY1Token.h:41
boost::shared_ptr< WPXInputStream > WPXInputStreamPtr_t
Definition: libetonyek_utils.h:88
KEYMemoryStream(const KEYMemoryStream &other)
const unsigned char * m_data
Definition: KEYMemoryStream.h:46
virtual const unsigned char * read(unsigned long numBytes, unsigned long &numBytesRead)
Definition: KEYMemoryStream.cpp:77
virtual bool atEOS()
Definition: KEYMemoryStream.cpp:132
void assign(const unsigned char *data, unsigned length)
Definition: KEYMemoryStream.cpp:137
virtual long tell()
Definition: KEYMemoryStream.cpp:127

Generated for libetonyek by doxygen 1.8.5