PMDParser.h Source File documentation

- Main Page
- Namespaces
- Classes
- Files

- File List
- File Members

PMDParser.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 libpagemaker 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 __PMDPARSER_H__
11 #define __PMDPARSER_H__
12
13 #include <librevenge/librevenge.h>
14
15 #include <stdint.h>
16 #include <map>
17 #include <set>
18
19 #include "PMDRecord.h"
20 #include "geometry.h"
21
22 namespace libpagemaker
23 {
24
25 class PMDCollector;
26 class PMDParser
27 {
28 librevenge::RVNGInputStream *m_input;
29 unsigned long m_length;
30 PMDCollector *m_collector;
31 std::map<uint16_t, std::vector<unsigned> > m_records;
32 bool m_bigEndian;
33 std::vector<PMDRecordContainer> m_recordsInOrder;
34 std::map<uint32_t, PMDXForm> m_xFormMap;
35
36 /* Private functions. */
37 void parseGlobalInfo(const PMDRecordContainer &container);
38 void parseFonts();
39 void parseColors();
40 void parsePages(const PMDRecordContainer &container);
41 void parseShapes(uint16_t seqNum, unsigned pageID);
42 void parseLine(const PMDRecordContainer &container, unsigned recordIndex, unsigned pageID);
43 void parseTextBox(const PMDRecordContainer &container, unsigned recordIndex, unsigned pageID);
44 void parseRectangle(const PMDRecordContainer &container, unsigned recordIndex, unsigned pageID);
45 void parsePolygon(const PMDRecordContainer &container, unsigned recordIndex, unsigned pageID);
46 void parseEllipse(const PMDRecordContainer &container, unsigned recordIndex, unsigned pageID);
47 void parseBitmap(const PMDRecordContainer &container, unsigned recordIndex, unsigned pageID);
48 void parseHeader(uint32_t *tocOffset, uint16_t *tocLength);
49 unsigned readNextRecordFromTableOfContents(std::set<unsigned long> &tocOffsets, unsigned &seqNum);
50 void parseTableOfContents(uint32_t offset, uint16_t length);
51 std::vector<PMDRecordContainer> getRecordsBySeqNum(const uint16_t seqNum);
52 std::vector<PMDRecordContainer> getRecordsByRecType(const uint16_t recType);
53 const PMDRecordContainer &getSingleRecordBySeqNum(const uint16_t seqNum) const;
54 void parseXforms();
55 const PMDXForm &getXForm(const uint32_t xFormId) const;
56
57 /* Prevent copy and assignment */
58 PMDParser &operator=(const PMDParser &);
59 PMDParser(const PMDParser &);
60 public:
61 PMDParser(librevenge::RVNGInputStream *, PMDCollector *);
62 void parse();
63 };
64
65 }
66
67 #endif /* __PMDPARSER_H__ */
68
69 /* vim:set shiftwidth=2 softtabstop=2 expandtab: */
libpagemaker::PMDParser::parsePages
void parsePages(const PMDRecordContainer &container)
Definition: PMDParser.cpp:652
libpagemaker::PMDParser::m_bigEndian
bool m_bigEndian
Definition: PMDParser.h:32
libpagemaker::PMDParser::parseTableOfContents
void parseTableOfContents(uint32_t offset, uint16_t length)
Definition: PMDParser.cpp:779
libpagemaker::PMDParser::parseShapes
void parseShapes(uint16_t seqNum, unsigned pageID)
Definition: PMDParser.cpp:497
libpagemaker::PMDParser::getXForm
const PMDXForm & getXForm(const uint32_t xFormId) const
Definition: PMDParser.cpp:87
libpagemaker::PMDParser::parseBitmap
void parseBitmap(const PMDRecordContainer &container, unsigned recordIndex, unsigned pageID)
Definition: PMDParser.cpp:444
libpagemaker::PMDParser::PMDParser
PMDParser(const PMDParser &)
libpagemaker::PMDParser::parseHeader
void parseHeader(uint32_t *tocOffset, uint16_t *tocLength)
Definition: PMDParser.cpp:673
libpagemaker::PMDParser::m_input
librevenge::RVNGInputStream * m_input
Definition: PMDParser.h:28
libpagemaker::PMDParser::getRecordsByRecType
std::vector< PMDRecordContainer > getRecordsByRecType(const uint16_t recType)
Definition: PMDParser.cpp:54
libpagemaker::PMDRecordContainer
Definition: PMDRecord.h:23
libpagemaker::PMDParser::parsePolygon
void parsePolygon(const PMDRecordContainer &container, unsigned recordIndex, unsigned pageID)
Definition: PMDParser.cpp:336
libpagemaker::PMDParser::parseLine
void parseLine(const PMDRecordContainer &container, unsigned recordIndex, unsigned pageID)
Definition: PMDParser.cpp:139
libpagemaker::PMDParser::parseGlobalInfo
void parseGlobalInfo(const PMDRecordContainer &container)
Definition: PMDParser.cpp:122
PMDRecord.h
libpagemaker::PMDParser::m_collector
PMDCollector * m_collector
Definition: PMDParser.h:30
libpagemaker::PMDParser::readNextRecordFromTableOfContents
unsigned readNextRecordFromTableOfContents(std::set< unsigned long > &tocOffsets, unsigned &seqNum)
Definition: PMDParser.cpp:714
libpagemaker::PMDParser::parseFonts
void parseFonts()
Definition: PMDParser.cpp:540
libpagemaker::PMDParser::getRecordsBySeqNum
std::vector< PMDRecordContainer > getRecordsBySeqNum(const uint16_t seqNum)
Definition: PMDParser.cpp:36
libpagemaker::PMDParser::parse
void parse()
Definition: PMDParser.cpp:802
libpagemaker::PMDParser::operator=
PMDParser & operator=(const PMDParser &)
libpagemaker::PMDParser::m_records
std::map< uint16_t, std::vector< unsigned > > m_records
Definition: PMDParser.h:31
libpagemaker
Definition: geometry.h:20
libpagemaker::PMDParser::parseTextBox
void parseTextBox(const PMDRecordContainer &container, unsigned recordIndex, unsigned pageID)
Definition: PMDParser.cpp:170
geometry.h
libpagemaker::PMDParser::m_length
unsigned long m_length
Definition: PMDParser.h:29
libpagemaker::PMDParser::parseRectangle
void parseRectangle(const PMDRecordContainer &container, unsigned recordIndex, unsigned pageID)
Definition: PMDParser.cpp:298
libpagemaker::PMDCollector
Builder class for PMD Documents.
Definition: PMDCollector.h:40
libpagemaker::PMDParser::parseXforms
void parseXforms()
Definition: PMDParser.cpp:623
libpagemaker::PMDParser::m_recordsInOrder
std::vector< PMDRecordContainer > m_recordsInOrder
Definition: PMDParser.h:33
libpagemaker::PMDParser::m_xFormMap
std::map< uint32_t, PMDXForm > m_xFormMap
Definition: PMDParser.h:34
libpagemaker::PMDParser::getSingleRecordBySeqNum
const PMDRecordContainer & getSingleRecordBySeqNum(const uint16_t seqNum) const
Definition: PMDParser.cpp:71
libpagemaker::PMDParser::parseColors
void parseColors()
Definition: PMDParser.cpp:573
libpagemaker::PMDParser::parseEllipse
void parseEllipse(const PMDRecordContainer &container, unsigned recordIndex, unsigned pageID)
Definition: PMDParser.cpp:405
libpagemaker::PMDXForm
Definition: geometry.h:34
libpagemaker::PMDParser
Definition: PMDParser.h:26