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

Generated for libe-book by doxygen 1.8.14