EBOOKUTF8Stream.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 libe-book 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 EBOOKUTF8STREAM_H_INCLUDED
11#define EBOOKUTF8STREAM_H_INCLUDED
12
13#include <memory>
14
15#include <librevenge/librevenge.h>
16
17namespace libebook
18{
19
20class EBOOKCharsetConverter;
21
22class EBOOKUTF8Stream : public librevenge::RVNGInputStream
23{
24public:
25 explicit EBOOKUTF8Stream(librevenge::RVNGInputStream *strm, EBOOKCharsetConverter *converter = nullptr);
26 ~EBOOKUTF8Stream() override;
27
28 bool isStructured() override;
29 unsigned subStreamCount() override;
30 const char *subStreamName(unsigned id) override;
31 bool existsSubStream(const char *name) override;
32 librevenge::RVNGInputStream *getSubStreamByName(const char *name) override;
33 RVNGInputStream *getSubStreamById(unsigned id) override;
34
35 const unsigned char *read(unsigned long numBytes, unsigned long &numBytesRead) override;
36 int seek(long offset, librevenge::RVNG_SEEK_TYPE seekType) override;
37 long tell() override;
38 bool isEnd() override;
39
40private:
41 std::unique_ptr<librevenge::RVNGInputStream> m_stream;
42};
43
44}
45
46#endif // EBOOKUTF8STREAM_H_INCLUDED
47
48/* vim:set shiftwidth=2 softtabstop=2 expandtab: */
string name
Definition: HTMLHelpStream.cpp:80
unsigned offset
Definition: SoftBookParser.cpp:74
Definition: EBOOKCharsetConverter.h:22
Definition: EBOOKUTF8Stream.h:23
librevenge::RVNGInputStream * getSubStreamByName(const char *name) override
Definition: EBOOKUTF8Stream.cpp:99
bool isStructured() override
Definition: EBOOKUTF8Stream.cpp:79
RVNGInputStream * getSubStreamById(unsigned id) override
Definition: EBOOKUTF8Stream.cpp:104
const unsigned char * read(unsigned long numBytes, unsigned long &numBytesRead) override
Definition: EBOOKUTF8Stream.cpp:110
bool existsSubStream(const char *name) override
Definition: EBOOKUTF8Stream.cpp:94
long tell() override
Definition: EBOOKUTF8Stream.cpp:120
~EBOOKUTF8Stream() override
Definition: EBOOKUTF8Stream.cpp:75
std::unique_ptr< librevenge::RVNGInputStream > m_stream
Definition: EBOOKUTF8Stream.h:41
unsigned subStreamCount() override
Definition: EBOOKUTF8Stream.cpp:84
const char * subStreamName(unsigned id) override
Definition: EBOOKUTF8Stream.cpp:89
EBOOKUTF8Stream(librevenge::RVNGInputStream *strm, EBOOKCharsetConverter *converter=nullptr)
Definition: EBOOKUTF8Stream.cpp:33
bool isEnd() override
Definition: EBOOKUTF8Stream.cpp:125
int seek(long offset, librevenge::RVNG_SEEK_TYPE seekType) override
Definition: EBOOKUTF8Stream.cpp:115
Definition: BBeBCollector.cpp:19

Generated for libe-book by doxygen 1.9.3