TealDocParser.h Source File documentation

TealDocParser.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 TEALDOCPARSER_H_INCLUDED
11#define TEALDOCPARSER_H_INCLUDED
12
13#include <memory>
14#include <vector>
15
16#include "PDBParser.h"
17
18
19namespace libebook
20{
21
22class EBOOKCharsetConverter;
23
24class TealDocTextParser;
25
26 class TealDocParser : public PDBParser
27{
28 // disable copying
29 TealDocParser(const TealDocParser &);
30 TealDocParser &operator=(const TealDocParser &);
31
32public:
33 explicit TealDocParser(librevenge::RVNGInputStream *input, librevenge::RVNGTextInterface *document = nullptr);
34 ~TealDocParser() override;
35
36 static bool checkType(unsigned type, unsigned creator);
37
38private:
39 void readAppInfoRecord(librevenge::RVNGInputStream *record) override;
40 void readSortInfoRecord(librevenge::RVNGInputStream *record) override;
41 void readIndexRecord(librevenge::RVNGInputStream *record) override;
42 void readDataRecord(librevenge::RVNGInputStream *record, bool last) override;
43
44 void createConverter(const std::vector<char> &text);
45
46 void openDocument();
47 void closeDocument();
48
49private:
50 bool m_compressed;
51 unsigned m_textLength;
52 unsigned m_recordCount;
53 unsigned m_recordSize;
54 unsigned m_read;
55
56 bool m_openedDocument;
57
58 std::unique_ptr<EBOOKCharsetConverter> m_converter;
59 std::unique_ptr<TealDocTextParser> m_textParser;
60};
61
62}
63
64#endif // TEALDOCPARSER_H_INCLUDED
65
66/* vim:set shiftwidth=2 softtabstop=2 expandtab: */
type
EBOOKDocument::Type type
Definition EBOOKDocument.cpp:325
document
XMLTreeNodePtr_t document
Definition EBOOKHTMLParser.cpp:163
PDBParser.h
text
qi::rule< Iterator, AttrValue_t, qi::space_type > text
Definition TealDocParser.cpp:232
libebook::PDBParser
Definition PDBParser.h:26
libebook::TealDocParser
Definition TealDocParser.h:27
libebook::TealDocParser::m_read
unsigned m_read
Definition TealDocParser.h:54
libebook::TealDocParser::m_openedDocument
bool m_openedDocument
Definition TealDocParser.h:56
libebook::TealDocParser::m_recordSize
unsigned m_recordSize
Definition TealDocParser.h:53
libebook::TealDocParser::m_converter
std::unique_ptr< EBOOKCharsetConverter > m_converter
Definition TealDocParser.h:58
libebook::TealDocParser::m_textParser
std::unique_ptr< TealDocTextParser > m_textParser
Definition TealDocParser.h:59
libebook::TealDocParser::readDataRecord
void readDataRecord(librevenge::RVNGInputStream *record, bool last) override
Definition TealDocParser.cpp:590
libebook::TealDocParser::createConverter
void createConverter(const std::vector< char > &text)
Definition TealDocParser.cpp:628
libebook::TealDocParser::m_recordCount
unsigned m_recordCount
Definition TealDocParser.h:52
libebook::TealDocParser::m_textLength
unsigned m_textLength
Definition TealDocParser.h:51
libebook::TealDocParser::TealDocParser
TealDocParser(const TealDocParser &)
libebook::TealDocParser::readAppInfoRecord
void readAppInfoRecord(librevenge::RVNGInputStream *record) override
Definition TealDocParser.cpp:565
libebook::TealDocParser::m_compressed
bool m_compressed
Definition TealDocParser.h:50
libebook::TealDocParser::closeDocument
void closeDocument()
Definition TealDocParser.cpp:668
libebook::TealDocParser::operator=
TealDocParser & operator=(const TealDocParser &)
libebook::TealDocParser::~TealDocParser
~TealDocParser() override
Definition TealDocParser.cpp:556
libebook::TealDocParser::readIndexRecord
void readIndexRecord(librevenge::RVNGInputStream *record) override
Definition TealDocParser.cpp:575
libebook::TealDocParser::openDocument
void openDocument()
Definition TealDocParser.cpp:644
libebook::TealDocParser::readSortInfoRecord
void readSortInfoRecord(librevenge::RVNGInputStream *record) override
Definition TealDocParser.cpp:570
libebook::TealDocParser::checkType
static bool checkType(unsigned type, unsigned creator)
Definition TealDocParser.cpp:560
libebook
Definition BBeBCollector.cpp:19