- Main Page
- Namespaces
- Classes
- Files

- File List
- File Members

CDRParser.h
Go to the documentation of this file.
1 /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
2 /* libcdr
3 * Version: MPL 1.1 / GPLv2+ / LGPLv2+
4 *
5 * The contents of this file are subject to the Mozilla Public License Version
6 * 1.1 (the "License"); you may not use this file except in compliance with
7 * the License or as specified alternatively below. You may obtain a copy of
8 * the License at http://www.mozilla.org/MPL/
9 *
10 * Software distributed under the License is distributed on an "AS IS" basis,
11 * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
12 * for the specific language governing rights and limitations under the
13 * License.
14 *
15 * Major Contributor(s):
16 * Copyright (C) 2011 Fridrich Strba <fridrich.strba@bluewin.ch>
17 *
18 *
19 * All Rights Reserved.
20 *
21 * For minor contributions see the git repository.
22 *
23 * Alternatively, the contents of this file may be used under the terms of
24 * either the GNU General Public License Version 2 or later (the "GPLv2+"), or
25 * the GNU Lesser General Public License Version 2 or later (the "LGPLv2+"),
26 * in which case the provisions of the GPLv2+ or the LGPLv2+ are applicable
27 * instead of those above.
28 */
29
30 #ifndef __CDRPARSER_H__
31 #define __CDRPARSER_H__
32
33 #include <stdio.h>
34 #include <iostream>
35 #include <vector>
36 #include <map>
37 #include <libwpd/libwpd.h>
38 #include <libwpd-stream/libwpd-stream.h>
39
40 namespace libcdr
41 {
42
43 class CDRCollector;
44
45 class CDRParser
46 {
47 public:
48 explicit CDRParser(WPXInputStream *input, const std::vector<WPXInputStream *> &externalStreams, CDRCollector *collector);
49 virtual ~CDRParser();
50 bool parseRecords(WPXInputStream *input, unsigned *blockLengths = 0, unsigned level = 0);
51
52 private:
53 CDRParser();
54 CDRParser(const CDRParser &);
55 CDRParser &operator=(const CDRParser &);
56 bool parseRecord(WPXInputStream *input, unsigned *blockLengths = 0, unsigned level = 0);
57 void readRecord(WPXString fourCC, unsigned length, WPXInputStream *input);
58 double readCoordinate(WPXInputStream *input);
59 double readAngle(WPXInputStream *input);
60
61 void readRectangle(WPXInputStream *input);
62 void readEllipse(WPXInputStream *input);
63 void readLineAndCurve(WPXInputStream *input);
64 // void readText(WPXInputStream *input);
65 void readBitmap(WPXInputStream *input);
66 void readOpacity(WPXInputStream *input, unsigned length);
67 void readTrfd(WPXInputStream *input, unsigned length);
68 void readFild(WPXInputStream *input, unsigned length);
69 void readOutl(WPXInputStream *input, unsigned length);
70 void readLoda(WPXInputStream *input, unsigned length);
71 void readFlags(WPXInputStream *input, unsigned length);
72 void readMcfg(WPXInputStream *input, unsigned length);
73 void readPath(WPXInputStream *input);
74 void readPolygonCoords(WPXInputStream *input);
75 void readPolygonTransform(WPXInputStream *input);
76 void readBmp(WPXInputStream *input, unsigned length);
77 void readBmpf(WPXInputStream *input, unsigned length);
78 void readPpdt(WPXInputStream *input, unsigned length);
79 void readFtil(WPXInputStream *input, unsigned length);
80 void readDisp(WPXInputStream *input, unsigned length);
81 void readVersion(WPXInputStream *input, unsigned length);
82
83 WPXInputStream *m_input;
84 std::vector<WPXInputStream *> m_externalStreams;
85 CDRCollector *m_collector;
86
87 unsigned m_version;
88 };
89 } // namespace libcdr
90
91 #endif // __CDRPARSER_H__
92 /* vim:set shiftwidth=2 softtabstop=2 expandtab: */
libcdr::CDRParser::readTrfd
void readTrfd(WPXInputStream *input, unsigned length)
Definition: CDRParser.cpp:636
libcdr::CDRParser::readBitmap
void readBitmap(WPXInputStream *input)
Definition: CDRParser.cpp:546
libcdr::CDRParser::readFlags
void readFlags(WPXInputStream *input, unsigned length)
Definition: CDRParser.cpp:1004
libcdr::CDRParser::~CDRParser
virtual ~CDRParser()
Definition: CDRParser.cpp:54
libcdr::CDRParser::readVersion
void readVersion(WPXInputStream *input, unsigned length)
Definition: CDRParser.cpp:1272
libcdr::CDRParser::readLoda
void readLoda(WPXInputStream *input, unsigned length)
Definition: CDRParser.cpp:939
libcdr::CDRParser::m_input
WPXInputStream * m_input
Definition: CDRParser.h:83
libcdr::CDRParser::parseRecord
bool parseRecord(WPXInputStream *input, unsigned *blockLengths=0, unsigned level=0)
Definition: CDRParser.cpp:73
libcdr::CDRParser::readRecord
void readRecord(WPXString fourCC, unsigned length, WPXInputStream *input)
Definition: CDRParser.cpp:155
libcdr::CDRParser::readPpdt
void readPpdt(WPXInputStream *input, unsigned length)
Definition: CDRParser.cpp:1221
libcdr::CDRParser::readAngle
double readAngle(WPXInputStream *input)
Definition: CDRParser.cpp:197
libcdr::CDRParser::readPolygonTransform
void readPolygonTransform(WPXInputStream *input)
Definition: CDRParser.cpp:1113
libcdr::CDRParser::m_version
unsigned m_version
Definition: CDRParser.h:87
libcdr::CDRParser::readMcfg
void readMcfg(WPXInputStream *input, unsigned length)
Definition: CDRParser.cpp:1021
libcdr::CDRParser::readDisp
void readDisp(WPXInputStream *input, unsigned length)
Definition: CDRParser.cpp:361
libcdr::CDRParser::CDRParser
CDRParser()
libcdr::CDRParser::readFild
void readFild(WPXInputStream *input, unsigned length)
Definition: CDRParser.cpp:708
libcdr::CDRParser::readBmp
void readBmp(WPXInputStream *input, unsigned length)
Definition: CDRParser.cpp:1132
libcdr::CDRParser::readCoordinate
double readCoordinate(WPXInputStream *input)
Definition: CDRParser.cpp:189
libcdr::CDRParser::readEllipse
void readEllipse(WPXInputStream *input)
Definition: CDRParser.cpp:311
libcdr::CDRParser::readOpacity
void readOpacity(WPXInputStream *input, unsigned length)
Definition: CDRParser.cpp:1176
libcdr::CDRParser::parseRecords
bool parseRecords(WPXInputStream *input, unsigned *blockLengths=0, unsigned level=0)
Definition: CDRParser.cpp:58
libcdr::CDRParser::readRectangle
void readRectangle(WPXInputStream *input)
Definition: CDRParser.cpp:202
libcdr::CDRParser::readOutl
void readOutl(WPXInputStream *input, unsigned length)
Definition: CDRParser.cpp:887
libcdr::CDRParser::readFtil
void readFtil(WPXInputStream *input, unsigned length)
Definition: CDRParser.cpp:1250
libcdr::CDRParser::m_externalStreams
std::vector< WPXInputStream * > m_externalStreams
Definition: CDRParser.h:84
libcdr::CDRParser::readBmpf
void readBmpf(WPXInputStream *input, unsigned length)
Definition: CDRParser.cpp:1186
libcdr::CDRParser
Definition: CDRParser.h:45
libcdr::CDRParser::operator=
CDRParser & operator=(const CDRParser &)
libcdr::CDRParser::readPath
void readPath(WPXInputStream *input)
Definition: CDRParser.cpp:469
libcdr::CDRParser::readPolygonCoords
void readPolygonCoords(WPXInputStream *input)
Definition: CDRParser.cpp:1045
libcdr::CDRParser::m_collector
CDRCollector * m_collector
Definition: CDRParser.h:85
libcdr::CDRCollector
Definition: CDRCollector.h:96
libcdr::CDRParser::readLineAndCurve
void readLineAndCurve(WPXInputStream *input)
Definition: CDRParser.cpp:402