TCRParser.h Source File documentation

TCRParser.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 TCRPARSER_H_INCLUDED
11 #define TCRPARSER_H_INCLUDED
12
13 #include <string>
14
15 namespace libebook
16 {
17
18 class TCRParser
19 {
20 // -Weffc++
21 TCRParser(const TCRParser &other);
22 TCRParser &operator=(const TCRParser &other);
23
24 public:
25
26 TCRParser(librevenge::RVNGInputStream *input, librevenge::RVNGTextInterface *document = nullptr);
27
28 bool parse();
29
30 private:
31 void readReplacementTable();
32
33 std::shared_ptr<librevenge::RVNGInputStream> uncompress();
34
35 void writeText(const std::shared_ptr<librevenge::RVNGInputStream> &input);
36
37 private:
38 librevenge::RVNGInputStream *const m_input;
39 librevenge::RVNGTextInterface *const m_document;
40
41 std::string m_replacementTable[256];
42 };
43
44 } // namespace libebook
45
46 #endif // TCRPARSER_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::RVNGInputStreamPtr_t
std::shared_ptr< librevenge::RVNGInputStream > RVNGInputStreamPtr_t
Definition: libebook_utils.h:54
libebook::TCRParser::writeText
void writeText(const std::shared_ptr< librevenge::RVNGInputStream > &input)
Definition: TCRParser.cpp:100
libebook::EBOOKUTF8Stream
Definition: EBOOKUTF8Stream.h:23
libebook
Definition: BBeBCollector.cpp:19
libebook_utils.h
text
qi::rule< Iterator, AttrValue_t, qi::space_type > text
Definition: TealDocParser.cpp:232
libebook::getDefaultPageSpanPropList
librevenge::RVNGPropertyList getDefaultPageSpanPropList()
Definition: libebook_utils.cpp:265
libebook::EBOOKMemoryStream
Definition: EBOOKMemoryStream.h:21
TCRParser.h
m_input
librevenge::RVNGInputStream * m_input
Definition: PeanutPressParser.cpp:262
libebook::TCRParser
Definition: TCRParser.h:19
libebook::readNBytes
const unsigned char * readNBytes(librevenge::RVNGInputStream *const input, const unsigned long numBytes)
Definition: libebook_utils.cpp:105
EBOOKMemoryStream.h
libebook::EBOOKHTMLToken::i
@ i
Definition: EBOOKHTMLToken.h:86
libebook::TCRParser::m_replacementTable
std::string m_replacementTable[256]
Definition: TCRParser.h:41
libebook::TCRParser::TCRParser
TCRParser(const TCRParser &other)
libebook::TCRParser::operator=
TCRParser & operator=(const TCRParser &other)
document
XMLTreeNodePtr_t document
Definition: EBOOKHTMLParser.cpp:163
libebook::UnsupportedFormat
Definition: libebook_utils.h:132
EBOOK_NUM_ELEMENTS
#define EBOOK_NUM_ELEMENTS(array)
Definition: libebook_utils.h:49
libebook::EBOOKHTMLToken::input
@ input
Definition: EBOOKHTMLToken.h:89
libebook::readU8
uint8_t readU8(librevenge::RVNGInputStream *input, bool)
Definition: libebook_utils.cpp:45
libebook::TCRParser::m_document
librevenge::RVNGTextInterface *const m_document
Definition: TCRParser.h:39
EBOOKUTF8Stream.h
EBOOKCharsetConverter.h
libebook::TCRParser::readReplacementTable
void readReplacementTable()
Definition: TCRParser.cpp:65
libebook::TCRParser::m_input
librevenge::RVNGInputStream *const m_input
Definition: TCRParser.h:38
libebook::TCRParser::parse
bool parse()
Definition: TCRParser.cpp:47
m_document
librevenge::RVNGTextInterface *const m_document
Definition: FictionBook2Parser.cpp:55
length
unsigned length
Definition: SoftBookParser.cpp:73
libebook::TCRParser::uncompress
std::shared_ptr< librevenge::RVNGInputStream > uncompress()
Definition: TCRParser.cpp:78