TDParser.h
Go to the documentation of this file.
1 /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
2 /* libe-book
3  * Version: MPL 2.0 / LGPLv2.1+
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  * Alternatively, the contents of this file may be used under the terms
10  * of the GNU Lesser General Public License Version 2.1 or later
11  * (LGPLv2.1+), in which case the provisions of the LGPLv2.1+ are
12  * applicable instead of those above.
13  *
14  * For further information visit http://libebook.sourceforge.net
15  */
16 
17 #ifndef TDPARSER_H_INCLUDED
18 #define TDPARSER_H_INCLUDED
19 
20 #include <vector>
21 
22 #include "PDXParser.h"
23 
24 class WPXDocumentInterface;
25 class WPXInputStream;
26 
27 namespace libebook
28 {
29 
30 class EBOOKCharsetConverter;
31 
32 class TDTextParser;
33 
34 class TDParser : public PDXParser
35 {
36  // disable copying
37  TDParser(const TDParser &);
38  TDParser &operator=(const TDParser &);
39 
40 public:
41  explicit TDParser(WPXInputStream *input, WPXDocumentInterface *document = 0);
42  virtual ~TDParser();
43 
44 private:
45  virtual bool isFormatSupported(unsigned type, unsigned creator);
46 
47  virtual void readAppInfoRecord(WPXInputStream *record);
48  virtual void readSortInfoRecord(WPXInputStream *record);
49  virtual void readIndexRecord(WPXInputStream *record);
50  virtual void readDataRecord(WPXInputStream *record, bool last);
51 
52  void createConverter(const std::vector<char> &text);
53 
54  void openDocument();
55  void closeDocument();
56 
57 private:
59  unsigned m_textLength;
60  unsigned m_recordCount;
61  unsigned m_recordSize;
62  unsigned m_read;
63 
65 
68 };
69 
70 }
71 
72 #endif // TDPARSER_H_INCLUDED
73 
74 /* vim:set shiftwidth=2 softtabstop=2 expandtab: */
virtual bool isFormatSupported(unsigned type, unsigned creator)
Check whether a specific subformat is supported.
Definition: TDParser.cpp:537
TDParser & operator=(const TDParser &)
Definition: TDParser.cpp:127
virtual ~TDParser()
Definition: TDParser.cpp:531
void createConverter(const std::vector< char > &text)
Definition: TDParser.cpp:605
Definition: EBOOKCharsetConverter.h:27
virtual void readSortInfoRecord(WPXInputStream *record)
Definition: TDParser.cpp:547
TDTextParser * m_textParser
Definition: TDParser.h:67
Definition: PDXParser.h:32
virtual void readDataRecord(WPXInputStream *record, bool last)
Definition: TDParser.cpp:567
unsigned m_recordCount
Definition: TDParser.h:60
virtual void readIndexRecord(WPXInputStream *record)
Definition: TDParser.cpp:552
unsigned m_read
Definition: TDParser.h:62
Definition: FB2Token.h:124
unsigned m_recordSize
Definition: TDParser.h:61
TDParser(const TDParser &)
bool m_compressed
Definition: TDParser.h:58
EBOOKCharsetConverter * m_converter
Definition: TDParser.h:66
virtual void readAppInfoRecord(WPXInputStream *record)
Definition: TDParser.cpp:542
void openDocument()
Definition: TDParser.cpp:620
void closeDocument()
Definition: TDParser.cpp:638
unsigned m_textLength
Definition: TDParser.h:59
bool m_openedDocument
Definition: TDParser.h:64
Definition: TDParser.h:34

Generated for libe-book by doxygen 1.8.5