ZTXTParser.h Source File documentation

ZTXTParser.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 ZTXTPARSER_H_INCLUDED
11 #define ZTXTPARSER_H_INCLUDED
12
13 #include "PDBParser.h"
14
15
16 namespace libebook
17 {
18
19 class ZTXTParser : public PDBParser
20 {
21 public:
22 explicit ZTXTParser(librevenge::RVNGInputStream *input, librevenge::RVNGTextInterface *document = nullptr);
23
24 static bool checkType(unsigned type, unsigned creator);
25
26 void readAppInfoRecord(librevenge::RVNGInputStream *record) override;
27 void readSortInfoRecord(librevenge::RVNGInputStream *record) override;
28 void readIndexRecord(librevenge::RVNGInputStream *record) override;
29 void readDataRecord(librevenge::RVNGInputStream *record, bool = true) override;
30
31 void readDataRecords() override;
32
33 private:
34 void openDocument();
35 void closeDocument();
36 void handleText(const librevenge::RVNGString &text);
37
38 private:
39 unsigned m_recordCount;
40 unsigned m_size;
41 unsigned m_recordSize;
42 };
43
44 } // namespace libebook
45
46 #endif // ZTXTPARSER_H_INCLUDED
47 /* vim:set shiftwidth=2 softtabstop=2 expandtab: */
libebook::ZTXT_CREATOR
static const uint32_t ZTXT_CREATOR
Definition: ZTXTParser.cpp:23
ZTXTParser.h
libebook::ZTXTParser::ZTXTParser
ZTXTParser(librevenge::RVNGInputStream *input, librevenge::RVNGTextInterface *document=nullptr)
Definition: ZTXTParser.cpp:25
libebook::ZTXTParser::readAppInfoRecord
void readAppInfoRecord(librevenge::RVNGInputStream *record) override
Definition: ZTXTParser.cpp:38
libebook::ZTXTParser::checkType
static bool checkType(unsigned type, unsigned creator)
Definition: ZTXTParser.cpp:33
libebook::PDBParser::getDataRecords
librevenge::RVNGInputStream * getDataRecords() const
Return a stream for all data records.
Definition: PDBParser.cpp:154
libebook::ZTXTParser::readDataRecords
void readDataRecords() override
Definition: ZTXTParser.cpp:74
libebook::ZTXTParser::readSortInfoRecord
void readSortInfoRecord(librevenge::RVNGInputStream *record) override
Definition: ZTXTParser.cpp:42
libebook::ZTXTParser::readDataRecord
void readDataRecord(librevenge::RVNGInputStream *record, bool=true) override
Definition: ZTXTParser.cpp:55
libebook
Definition: BBeBCollector.cpp:19
libebook::ZTXTParser::m_recordSize
unsigned m_recordSize
Definition: ZTXTParser.h:41
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::ZTXTParser::openDocument
void openDocument()
Definition: ZTXTParser.cpp:86
libebook::PDBParser
Definition: PDBParser.h:26
libebook::ZTXTParser::m_recordCount
unsigned m_recordCount
Definition: ZTXTParser.h:39
libebook::EBOOKOPFToken::creator
@ creator
Definition: EBOOKOPFToken.h:50
document
XMLTreeNodePtr_t document
Definition: EBOOKHTMLParser.cpp:163
libebook::ZTXT_TYPE
static const uint32_t ZTXT_TYPE
Definition: ZTXTParser.cpp:22
PDBParser.h
metadata
RVNGPropertyList metadata
Definition: EBOOKOPFParser.cpp:63
libebook::EBOOKHTMLToken::input
@ input
Definition: EBOOKHTMLToken.h:89
libebook::readU16
uint16_t readU16(librevenge::RVNGInputStream *input, bool bigEndian)
Definition: libebook_utils.cpp:57
libebook::ZTXTParser::closeDocument
void closeDocument()
Definition: ZTXTParser.cpp:97
libebook::readU8
uint8_t readU8(librevenge::RVNGInputStream *input, bool)
Definition: libebook_utils.cpp:45
libebook::EBOOKZlibStream
Definition: EBOOKZlibStream.h:21
libebook::ZTXTParser::readIndexRecord
void readIndexRecord(librevenge::RVNGInputStream *record) override
Definition: ZTXTParser.cpp:46
libebook::readU32
uint32_t readU32(librevenge::RVNGInputStream *input, bool bigEndian)
Definition: libebook_utils.cpp:73
libebook::ZTXTParser::handleText
void handleText(const librevenge::RVNGString &text)
Definition: ZTXTParser.cpp:103
libebook::PDBParser::getDocument
librevenge::RVNGTextInterface * getDocument() const
Get the document generator used for this parsing run.
Definition: PDBParser.cpp:123
libebook::PDBParser::getName
const char * getName() const
Definition: PDBParser.cpp:128
m_size
const size_t m_size
Definition: SoftBookLZSSStream.cpp:51
EBOOKZlibStream.h
type
EBOOKDocument::Type type
Definition: EBOOKDocument.cpp:325
PDB_CODE
#define PDB_CODE(s)
Definition: PDBParser.h:18
libebook::ZTXTParser::m_size
unsigned m_size
Definition: ZTXTParser.h:40
libebook::ZTXTParser
Definition: ZTXTParser.h:20