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 #include <boost/shared_ptr.hpp>
16 
17 namespace libebook
18 {
19 
20 class TCRParser
21 {
22  // -Weffc++
23  TCRParser(const TCRParser &other);
24  TCRParser &operator=(const TCRParser &other);
25 
26 public:
27 
28  TCRParser(librevenge::RVNGInputStream *input, librevenge::RVNGTextInterface *document = 0);
29 
30  bool parse();
31 
32 private:
33  void readReplacementTable();
34 
35  boost::shared_ptr<librevenge::RVNGInputStream> uncompress();
36 
37  void writeText(const boost::shared_ptr<librevenge::RVNGInputStream> &input);
38 
39 private:
40  librevenge::RVNGInputStream *const m_input;
41  librevenge::RVNGTextInterface *const m_document;
42 
43  std::string m_replacementTable[256];
44 };
45 
46 } // namespace libebook
47 
48 #endif // TCRPARSER_H_INCLUDED
49 
50 /* vim:set shiftwidth=2 softtabstop=2 expandtab: */
libebook::EBOOKCharsetConverter::guessEncoding
bool guessEncoding(const char *in, unsigned length)
Definition: EBOOKCharsetConverter.cpp:99
libebook::EBOOKCharsetConverter
Definition: EBOOKCharsetConverter.h:21
length
unsigned length
Definition: IMPParser.cpp:72
libebook::EBOOKUTF8Stream
Definition: EBOOKUTF8Stream.h:23
libebook::RVNGInputStreamPtr_t
boost::shared_ptr< librevenge::RVNGInputStream > RVNGInputStreamPtr_t
Definition: libebook_utils.h:82
libebook
Definition: CHMParser.cpp:21
libebook_utils.h
libebook::EBOOKMemoryStream
Definition: EBOOKMemoryStream.h:19
TCRParser.h
libebook::TCRParser
Definition: TCRParser.h:21
libebook::readNBytes
const unsigned char * readNBytes(librevenge::RVNGInputStream *const input, const unsigned long numBytes)
Definition: libebook_utils.cpp:103
EBOOKMemoryStream.h
libebook::EBOOKHTMLToken::i
@ i
Definition: EBOOKHTMLToken.h:88
libebook::TCRParser::m_replacementTable
std::string m_replacementTable[256]
Definition: TCRParser.h:43
libebook::TCRParser::TCRParser
TCRParser(const TCRParser &other)
m_document
librevenge::RVNGTextInterface *const m_document
Definition: FB2Parser.cpp:56
libebook::TCRParser::operator=
TCRParser & operator=(const TCRParser &other)
document
XMLTreeNodePtr_t document
Definition: EBOOKHTMLParser.cpp:169
libebook::EBOOKHTMLToken::text
@ text
Definition: EBOOKHTMLToken.h:259
libebook::UnsupportedFormat
Definition: libebook_utils.h:158
EBOOK_NUM_ELEMENTS
#define EBOOK_NUM_ELEMENTS(array)
Definition: libebook_utils.h:77
libebook::EBOOKHTMLToken::input
@ input
Definition: EBOOKHTMLToken.h:91
libebook::readU8
uint8_t readU8(librevenge::RVNGInputStream *input, bool)
Definition: libebook_utils.cpp:43
libebook::TCRParser::m_document
librevenge::RVNGTextInterface *const m_document
Definition: TCRParser.h:41
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:40
libebook::TCRParser::parse
bool parse()
Definition: TCRParser.cpp:47
m_input
librevenge::RVNGInputStream * m_input
Definition: PLKRParser.cpp:911
libebook::TCRParser::writeText
void writeText(const boost::shared_ptr< librevenge::RVNGInputStream > &input)
Definition: TCRParser.cpp:100
libebook::TCRParser::uncompress
boost::shared_ptr< librevenge::RVNGInputStream > uncompress()
Definition: TCRParser.cpp:78

Generated for libe-book by doxygen 1.8.18