KEYMemoryStream.h Source File documentation

- Main Page
- Related Pages
- Namespaces
- Classes
- Files

- File List
- File Members

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 librevenge::RVNGInputStream
21 {
22 // -Weffc++
23 KEYMemoryStream(const KEYMemoryStream &other);
24 KEYMemoryStream &operator=(const KEYMemoryStream &other);
25
26 public:
27 explicit KEYMemoryStream(const RVNGInputStreamPtr_t &input);
28 KEYMemoryStream(const RVNGInputStreamPtr_t &input, unsigned length);
29 explicit KEYMemoryStream(std::vector<unsigned char> &data);
30 KEYMemoryStream(const unsigned char *data, unsigned length);
31 ~KEYMemoryStream();
32
33 bool isStructured();
34 unsigned subStreamCount();
35 const char *subStreamName(unsigned id);
36 bool existsSubStream(const char *)
37 {
38 return false;
39 }
40 librevenge::RVNGInputStream *getSubStreamByName(const char *name);
41 librevenge::RVNGInputStream *getSubStreamById(unsigned id);
42
43 const unsigned char *read(unsigned long numBytes, unsigned long &numBytesRead);
44 int seek(long offset, librevenge::RVNG_SEEK_TYPE seekType);
45 long tell();
46 bool isEnd();
47
48 private:
49 void assign(const unsigned char *data, unsigned length);
50 void read(const RVNGInputStreamPtr_t &input, unsigned length);
51
52 private:
53 const unsigned char *m_data;
54 long m_length;
55 long m_pos;
56 };
57
58 }
59
60 #endif // KEYMEMORYSTREAM_H_INCLUDED
61
62 /* vim:set shiftwidth=2 softtabstop=2 expandtab: */
libetonyek::KEY1Token::offset
Definition: KEY1Token.h:139
libetonyek
Definition: EtonyekDocument.cpp:40
libetonyek::KEYMemoryStream::operator=
KEYMemoryStream & operator=(const KEYMemoryStream &other)
libetonyek::KEYMemoryStream::~KEYMemoryStream
~KEYMemoryStream()
Definition: KEYMemoryStream.cpp:66
libetonyek::KEYMemoryStream::m_length
long m_length
Definition: KEYMemoryStream.h:54
libetonyek::KEYMemoryStream
Definition: KEYMemoryStream.h:20
libetonyek::KEY2Token::length
Definition: KEY2Token.h:1015
libetonyek::KEYMemoryStream::subStreamName
const char * subStreamName(unsigned id)
Definition: KEYMemoryStream.cpp:81
libetonyek::KEYMemoryStream::m_pos
long m_pos
Definition: KEYMemoryStream.h:55
libetonyek::KEY1Token::data
Definition: KEY1Token.h:41
libetonyek::KEYMemoryStream::KEYMemoryStream
KEYMemoryStream(const KEYMemoryStream &other)
libetonyek::KEYMemoryStream::m_data
const unsigned char * m_data
Definition: KEYMemoryStream.h:53
libetonyek::KEYMemoryStream::getSubStreamByName
librevenge::RVNGInputStream * getSubStreamByName(const char *name)
Definition: KEYMemoryStream.cpp:86
libetonyek::KEYMemoryStream::getSubStreamById
librevenge::RVNGInputStream * getSubStreamById(unsigned id)
Definition: KEYMemoryStream.cpp:91
libetonyek::KEYMemoryStream::read
const unsigned char * read(unsigned long numBytes, unsigned long &numBytesRead)
Definition: KEYMemoryStream.cpp:96
libetonyek::RVNGInputStreamPtr_t
boost::shared_ptr< librevenge::RVNGInputStream > RVNGInputStreamPtr_t
Definition: libetonyek_utils.h:88
libetonyek::KEYMemoryStream::existsSubStream
bool existsSubStream(const char *)
Definition: KEYMemoryStream.h:36
libetonyek::KEYMemoryStream::isEnd
bool isEnd()
Definition: KEYMemoryStream.cpp:151
libetonyek::KEYMemoryStream::isStructured
bool isStructured()
Definition: KEYMemoryStream.cpp:71
input
RVNGInputStreamPtr_t input
Definition: EtonyekDocument.cpp:59
libetonyek::KEY1Token::name
Definition: KEY1Token.h:136
libetonyek::KEYMemoryStream::assign
void assign(const unsigned char *data, unsigned length)
Definition: KEYMemoryStream.cpp:156
libetonyek::KEYMemoryStream::tell
long tell()
Definition: KEYMemoryStream.cpp:146
libetonyek::KEYMemoryStream::seek
int seek(long offset, librevenge::RVNG_SEEK_TYPE seekType)
Definition: KEYMemoryStream.cpp:117
libetonyek_utils.h
libetonyek::KEYMemoryStream::subStreamCount
unsigned subStreamCount()
Definition: KEYMemoryStream.cpp:76