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

Generated for libetonyek by doxygen 1.9.3