EBOOKUTF8Stream.h Source File documentation

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
22 class 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: */
name
string name
Definition: HTMLHelpStream.cpp:80
offset
unsigned offset
Definition: SoftBookParser.cpp:74
libebook::EBOOKCharsetConverter
Definition: EBOOKCharsetConverter.h:22
libebook::EBOOKUTF8Stream
Definition: EBOOKUTF8Stream.h:23
libebook::EBOOKUTF8Stream::getSubStreamByName
librevenge::RVNGInputStream * getSubStreamByName(const char *name) override
Definition: EBOOKUTF8Stream.cpp:99
libebook::EBOOKUTF8Stream::isStructured
bool isStructured() override
Definition: EBOOKUTF8Stream.cpp:79
libebook::EBOOKUTF8Stream::getSubStreamById
RVNGInputStream * getSubStreamById(unsigned id) override
Definition: EBOOKUTF8Stream.cpp:104
libebook::EBOOKUTF8Stream::read
const unsigned char * read(unsigned long numBytes, unsigned long &numBytesRead) override
Definition: EBOOKUTF8Stream.cpp:110
libebook::EBOOKUTF8Stream::existsSubStream
bool existsSubStream(const char *name) override
Definition: EBOOKUTF8Stream.cpp:94
libebook::EBOOKUTF8Stream::tell
long tell() override
Definition: EBOOKUTF8Stream.cpp:120
libebook::EBOOKUTF8Stream::~EBOOKUTF8Stream
~EBOOKUTF8Stream() override
Definition: EBOOKUTF8Stream.cpp:75
libebook::EBOOKUTF8Stream::m_stream
std::unique_ptr< librevenge::RVNGInputStream > m_stream
Definition: EBOOKUTF8Stream.h:41
libebook::EBOOKUTF8Stream::subStreamCount
unsigned subStreamCount() override
Definition: EBOOKUTF8Stream.cpp:84
libebook::EBOOKUTF8Stream::subStreamName
const char * subStreamName(unsigned id) override
Definition: EBOOKUTF8Stream.cpp:89
libebook::EBOOKUTF8Stream::EBOOKUTF8Stream
EBOOKUTF8Stream(librevenge::RVNGInputStream *strm, EBOOKCharsetConverter *converter=nullptr)
Definition: EBOOKUTF8Stream.cpp:33
libebook::EBOOKUTF8Stream::isEnd
bool isEnd() override
Definition: EBOOKUTF8Stream.cpp:125
libebook::EBOOKUTF8Stream::seek
int seek(long offset, librevenge::RVNG_SEEK_TYPE seekType) override
Definition: EBOOKUTF8Stream.cpp:115
libebook
Definition: BBeBCollector.cpp:19