PluckerParser.h Source File documentation

PluckerParser.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 PLUCKERPARSER_H_INCLUDED
11#define PLUCKERPARSER_H_INCLUDED
12
13#include <map>
14#include <memory>
15#include <vector>
16
17#include "PDBParser.h"
18
19namespace libebook
20{
21
22 typedef std::map<unsigned, std::vector<unsigned char> > PluckerImageMap_t;
23
24struct PluckerHeader;
25struct PluckerParserState;
26struct PluckerRecordHeader;
27
28 class PluckerParser : public PDBParser
29{
30 // -Weffc++
31 PluckerParser(const PluckerParser &other);
32 PluckerParser &operator=(const PluckerParser &other);
33
34public:
35 explicit PluckerParser(librevenge::RVNGInputStream *input, librevenge::RVNGTextInterface *document = nullptr);
36
37 static bool checkType(unsigned type, unsigned creator);
38
39private:
40 void readAppInfoRecord(librevenge::RVNGInputStream *record) override;
41 void readSortInfoRecord(librevenge::RVNGInputStream *record) override;
42 void readIndexRecord(librevenge::RVNGInputStream *record) override;
43 void readDataRecord(librevenge::RVNGInputStream *record, bool last = false) override;
44
45 void readDataRecords() override;
46
47 void readMetadata(librevenge::RVNGInputStream *input, const PluckerRecordHeader &header);
48 void readImage(librevenge::RVNGInputStream *input, const PluckerRecordHeader &header);
49 void readText(librevenge::RVNGInputStream *input, const PluckerRecordHeader &header, const std::vector<unsigned> &paragraphLengths);
50
51 std::shared_ptr<librevenge::RVNGInputStream> getUncompressedStream(librevenge::RVNGInputStream *input) const;
52
53private:
54 std::shared_ptr<PluckerHeader> m_header;
55 const std::shared_ptr<PluckerParserState> m_state;
56};
57
58} // namespace libebook
59
60#endif // PLUCKERPARSER_H_INCLUDED
61/* 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
libebook::PDBParser
Definition: PDBParser.h:26
libebook::PluckerParser
Definition: PluckerParser.h:29
libebook::PluckerParser::readIndexRecord
void readIndexRecord(librevenge::RVNGInputStream *record) override
Definition: PluckerParser.cpp:1222
libebook::PluckerParser::getUncompressedStream
std::shared_ptr< librevenge::RVNGInputStream > getUncompressedStream(librevenge::RVNGInputStream *input) const
Definition: PluckerParser.cpp:1413
libebook::PluckerParser::readMetadata
void readMetadata(librevenge::RVNGInputStream *input, const PluckerRecordHeader &header)
Definition: PluckerParser.cpp:1360
libebook::PluckerParser::readSortInfoRecord
void readSortInfoRecord(librevenge::RVNGInputStream *record) override
Definition: PluckerParser.cpp:1217
libebook::PluckerParser::checkType
static bool checkType(unsigned type, unsigned creator)
Definition: PluckerParser.cpp:1203
libebook::PluckerParser::PluckerParser
PluckerParser(const PluckerParser &other)
libebook::PluckerParser::readText
void readText(librevenge::RVNGInputStream *input, const PluckerRecordHeader &header, const std::vector< unsigned > &paragraphLengths)
Definition: PluckerParser.cpp:1408
libebook::PluckerParser::readDataRecord
void readDataRecord(librevenge::RVNGInputStream *record, bool last=false) override
Definition: PluckerParser.cpp:1244
libebook::PluckerParser::readImage
void readImage(librevenge::RVNGInputStream *input, const PluckerRecordHeader &header)
Definition: PluckerParser.cpp:1399
libebook::PluckerParser::readDataRecords
void readDataRecords() override
Definition: PluckerParser.cpp:1250
libebook::PluckerParser::m_header
std::shared_ptr< PluckerHeader > m_header
Definition: PluckerParser.h:54
libebook::PluckerParser::operator=
PluckerParser & operator=(const PluckerParser &other)
libebook::PluckerParser::m_state
const std::shared_ptr< PluckerParserState > m_state
Definition: PluckerParser.h:55
libebook::PluckerParser::readAppInfoRecord
void readAppInfoRecord(librevenge::RVNGInputStream *record) override
Definition: PluckerParser.cpp:1208
libebook
Definition: BBeBCollector.cpp:19
libebook::PluckerImageMap_t
std::map< unsigned, std::vector< unsigned char > > PluckerImageMap_t
Definition: PluckerParser.h:22
libebook::PluckerHeader
Definition: PluckerParser.cpp:1121
libebook::PluckerParserState
Definition: PluckerParser.cpp:1132
libebook::PluckerRecordHeader
Definition: PluckerParser.cpp:1143