PeanutPressParser.h Source File documentation

PeanutPressParser.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 PEANUTPRESSPARSER_H_INCLUDED
11#define PEANUTPRESSPARSER_H_INCLUDED
12
13#include <string>
14#include <unordered_map>
15#include <vector>
16
17#include "PDBParser.h"
18
19
20namespace libebook
21{
22
23struct PeanutPressHeader;
24
25 class PeanutPressParser : public PDBParser
26{
27public:
28 typedef std::unordered_map<std::string, std::vector<unsigned char> > ImageMap_t;
29
30public:
31 explicit PeanutPressParser(librevenge::RVNGInputStream *input, librevenge::RVNGTextInterface *document = nullptr);
32 ~PeanutPressParser() override;
33
34 static bool checkType(unsigned type, unsigned creator);
35
36 void readAppInfoRecord(librevenge::RVNGInputStream *record) override;
37 void readSortInfoRecord(librevenge::RVNGInputStream *record) override;
38 void readIndexRecord(librevenge::RVNGInputStream *record) override;
39 void readDataRecord(librevenge::RVNGInputStream *record, bool last = false) override;
40
41 void readDataRecords() override;
42
43private:
44 void readText();
45 void readImages();
46 void readImage(librevenge::RVNGInputStream *record, bool verified = false);
47
48 void openDocument();
49 void closeDocument();
50
51private:
52 std::unique_ptr<PeanutPressHeader> m_header;
53 ImageMap_t m_imageMap;
54};
55
56} // namespace libebook
57
58#endif // PEANUTPRESSPARSER_H_INCLUDED
59/* vim:set shiftwidth=2 softtabstop=2 expandtab: */
PDBParser.h
libebook::PDBParser::PDBParser
PDBParser(const PDBParser &other)
libebook::PeanutPressParser::readAppInfoRecord
void readAppInfoRecord(librevenge::RVNGInputStream *record) override
Definition PeanutPressParser.cpp:725
libebook::PeanutPressParser::readDataRecord
void readDataRecord(librevenge::RVNGInputStream *record, bool last=false) override
Definition PeanutPressParser.cpp:769
libebook::PeanutPressParser::m_header
std::unique_ptr< PeanutPressHeader > m_header
Definition PeanutPressParser.h:52
libebook::PeanutPressParser::readDataRecords
void readDataRecords() override
Definition PeanutPressParser.cpp:776
libebook::PeanutPressParser::readIndexRecord
void readIndexRecord(librevenge::RVNGInputStream *record) override
Definition PeanutPressParser.cpp:733
libebook::PeanutPressParser::PeanutPressParser
PeanutPressParser(librevenge::RVNGInputStream *input, librevenge::RVNGTextInterface *document=nullptr)
Definition PeanutPressParser.cpp:702
libebook::PeanutPressParser::~PeanutPressParser
~PeanutPressParser() override
Definition PeanutPressParser.cpp:716
libebook::PeanutPressParser::openDocument
void openDocument()
Definition PeanutPressParser.cpp:899
libebook::PeanutPressParser::readSortInfoRecord
void readSortInfoRecord(librevenge::RVNGInputStream *record) override
Definition PeanutPressParser.cpp:729
libebook::PeanutPressParser::readImage
void readImage(librevenge::RVNGInputStream *record, bool verified=false)
Definition PeanutPressParser.cpp:875
libebook::PeanutPressParser::checkType
static bool checkType(unsigned type, unsigned creator)
Definition PeanutPressParser.cpp:720
libebook::PeanutPressParser::readText
void readText()
Definition PeanutPressParser.cpp:782
libebook::PeanutPressParser::closeDocument
void closeDocument()
Definition PeanutPressParser.cpp:905
libebook::PeanutPressParser::ImageMap_t
std::unordered_map< std::string, std::vector< unsigned char > > ImageMap_t
Definition PeanutPressParser.h:28
libebook::PeanutPressParser::readImages
void readImages()
Definition PeanutPressParser.cpp:848
libebook::PeanutPressParser::m_imageMap
ImageMap_t m_imageMap
Definition PeanutPressParser.h:53
libebook::EBOOKHTMLToken::type
@ type
Definition EBOOKHTMLToken.h:258
libebook::EBOOKHTMLToken::input
@ input
Definition EBOOKHTMLToken.h:89
libebook::EBOOKOPFToken::creator
@ creator
Definition EBOOKOPFToken.h:50
libebook
Definition BBeBCollector.cpp:19
libebook::PeanutPressHeader
Definition PeanutPressParser.cpp:663