TDParser.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 TDPARSER_H_INCLUDED
11 #define TDPARSER_H_INCLUDED
12
13 #include <vector>
14
15 #include "PDXParser.h"
16
17
18 namespace libebook
19 {
20
21 class EBOOKCharsetConverter;
22
23 class TDTextParser;
24
25 class TDParser : public PDXParser
26 {
27 // disable copying
28 TDParser(const TDParser &);
29 TDParser &operator=(const TDParser &);
30
31 public:
32 explicit TDParser(librevenge::RVNGInputStream *input, librevenge::RVNGTextInterface *document = 0);
33 virtual ~TDParser();
34
35 static bool checkType(unsigned type, unsigned creator);
36
37 private:
38 virtual void readAppInfoRecord(librevenge::RVNGInputStream *record);
39 virtual void readSortInfoRecord(librevenge::RVNGInputStream *record);
40 virtual void readIndexRecord(librevenge::RVNGInputStream *record);
41 virtual void readDataRecord(librevenge::RVNGInputStream *record, bool last);
42
43 void createConverter(const std::vector<char> &text);
44
45 void openDocument();
46 void closeDocument();
47
48 private:
49 bool m_compressed;
50 unsigned m_textLength;
51 unsigned m_recordCount;
52 unsigned m_recordSize;
53 unsigned m_read;
54
55 bool m_openedDocument;
56
57 EBOOKCharsetConverter *m_converter;
58 TDTextParser *m_textParser;
59 };
60
61 }
62
63 #endif // TDPARSER_H_INCLUDED
64
65 /* vim:set shiftwidth=2 softtabstop=2 expandtab: */
libebook::TDParser::operator=
TDParser & operator=(const TDParser &)
libebook::TDTextParser
Definition: TDParser.cpp:119
libebook::TDParser::readSortInfoRecord
virtual void readSortInfoRecord(librevenge::RVNGInputStream *record)
Definition: TDParser.cpp:530
libebook::TDParser::~TDParser
virtual ~TDParser()
Definition: TDParser.cpp:514
libebook::TDParser::createConverter
void createConverter(const std::vector< char > &text)
Definition: TDParser.cpp:588
libebook::EBOOKCharsetConverter
Definition: EBOOKCharsetConverter.h:20
libebook::EBOOKHTMLToken::text
Definition: EBOOKHTMLToken.h:259
libebook::TDParser::m_textParser
TDTextParser * m_textParser
Definition: TDParser.h:58
libebook::PDXParser
Definition: PDXParser.h:25
libebook::EBOOKOPFToken::creator
Definition: EBOOKOPFToken.h:52
type
EBOOKDocument::Type type
Definition: EBOOKDocument.cpp:328
libebook::TDParser::checkType
static bool checkType(unsigned type, unsigned creator)
Definition: TDParser.cpp:520
PDXParser.h
libebook::TDParser::m_recordCount
unsigned m_recordCount
Definition: TDParser.h:51
libebook::TDParser::readAppInfoRecord
virtual void readAppInfoRecord(librevenge::RVNGInputStream *record)
Definition: TDParser.cpp:525
libebook::TDParser::m_read
unsigned m_read
Definition: TDParser.h:53
libebook::TDParser::m_recordSize
unsigned m_recordSize
Definition: TDParser.h:52
libebook::TDParser::TDParser
TDParser(const TDParser &)
libebook::TDParser::m_compressed
bool m_compressed
Definition: TDParser.h:49
document
XMLTreeNodePtr_t document
Definition: EBOOKHTMLParser.cpp:169
libebook::TDParser::readIndexRecord
virtual void readIndexRecord(librevenge::RVNGInputStream *record)
Definition: TDParser.cpp:535
libebook::TDParser::m_converter
EBOOKCharsetConverter * m_converter
Definition: TDParser.h:57
libebook::EBOOKHTMLToken::input
Definition: EBOOKHTMLToken.h:91
libebook
Definition: CHMParser.cpp:20
libebook::TDParser::readDataRecord
virtual void readDataRecord(librevenge::RVNGInputStream *record, bool last)
Definition: TDParser.cpp:550
libebook::TDParser::openDocument
void openDocument()
Definition: TDParser.cpp:603
libebook::TDParser::closeDocument
void closeDocument()
Definition: TDParser.cpp:627
libebook::TDParser::m_textLength
unsigned m_textLength
Definition: TDParser.h:50
libebook::TDParser::m_openedDocument
bool m_openedDocument
Definition: TDParser.h:55
libebook::TDParser
Definition: TDParser.h:25