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 
17 namespace libebook
18 {
19 
20 class EBOOKCharsetConverter;
21 
22 class EBOOKUTF8Stream : public librevenge::RVNGInputStream
23 {
24 public:
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 
40 private:
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: */
libebook::EBOOKCharsetConverter::guessEncoding
bool guessEncoding(const char *in, unsigned length)
Definition: EBOOKCharsetConverter.cpp:91
libebook::EBOOKCharsetConverter
Definition: EBOOKCharsetConverter.h:22
libebook::EBOOKUTF8Stream::~EBOOKUTF8Stream
~EBOOKUTF8Stream() override
Definition: EBOOKUTF8Stream.cpp:75
libebook::EBOOKUTF8Stream::existsSubStream
bool existsSubStream(const char *name) override
Definition: EBOOKUTF8Stream.cpp:94
libebook::EBOOKUTF8Stream::EBOOKUTF8Stream
EBOOKUTF8Stream(librevenge::RVNGInputStream *strm, EBOOKCharsetConverter *converter=nullptr)
Definition: EBOOKUTF8Stream.cpp:33
m_stream
std::unique_ptr< librevenge::RVNGInputStream > m_stream
Definition: PeanutPressParser.cpp:74
libebook::EBOOKUTF8Stream
Definition: EBOOKUTF8Stream.h:23
libebook
Definition: BBeBCollector.cpp:19
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_utils.h
libebook::EBOOKMemoryStream
Definition: EBOOKMemoryStream.h:21
libebook::EBOOKUTF8Stream::m_stream
std::unique_ptr< librevenge::RVNGInputStream > m_stream
Definition: EBOOKUTF8Stream.h:41
libebook::EBOOKUTF8Stream::seek
int seek(long offset, librevenge::RVNG_SEEK_TYPE seekType) override
Definition: EBOOKUTF8Stream.cpp:115
EBOOKMemoryStream.h
offset
unsigned offset
Definition: SoftBookParser.cpp:74
libebook::EBOOKUTF8Stream::subStreamCount
unsigned subStreamCount() override
Definition: EBOOKUTF8Stream.cpp:84
libebook::EBOOKUTF8Stream::isStructured
bool isStructured() override
Definition: EBOOKUTF8Stream.cpp:79
data
MSPackFileData * data
Definition: HTMLHelpStream.cpp:63
libebook::EBOOKCharsetConverter::convertBytes
bool convertBytes(const char *in, unsigned length, std::vector< char > &out)
Definition: EBOOKCharsetConverter.cpp:109
libebook::EBOOKUTF8Stream::subStreamName
const char * subStreamName(unsigned id) override
Definition: EBOOKUTF8Stream.cpp:89
name
string name
Definition: HTMLHelpStream.cpp:80
EBOOKUTF8Stream.h
EBOOKCharsetConverter.h
libebook::readNBytes
const unsigned char * readNBytes(librevenge::RVNGInputStream *const input, const unsigned long numBytes)
Definition: libebook_utils.cpp:105
libebook::EBOOKUTF8Stream::getSubStreamByName
librevenge::RVNGInputStream * getSubStreamByName(const char *name) override
Definition: EBOOKUTF8Stream.cpp:99
libebook::EBOOKUTF8Stream::tell
long tell() override
Definition: EBOOKUTF8Stream.cpp:120
libebook::EBOOKUTF8Stream::isEnd
bool isEnd() override
Definition: EBOOKUTF8Stream.cpp:125
libebook::EBOOKHTMLToken::s
@ s
Definition: EBOOKHTMLToken.h:125

Generated for libe-book by doxygen 1.8.20