CommonParser.h Source File documentation

- Main Page
- Namespaces
- Classes
- Files

- File List
- File Members

CommonParser.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 libcdr 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 __COMMONPARSER_H__
11 #define __COMMONPARSER_H__
12
13 #include "CDRCollector.h"
14 #include "CDRPath.h"
15
16 namespace libcdr
17 {
18
19 enum CoordinatePrecision
20 { PRECISION_UNKNOWN = 0, PRECISION_16BIT, PRECISION_32BIT };
21
22 class CommonParser
23 {
24 public:
25 CommonParser(CDRCollector *collector);
26 virtual ~CommonParser();
27
28 private:
29 CommonParser();
30 CommonParser(const CommonParser &);
31 CommonParser &operator=(const CommonParser &);
32
33
34 protected:
35 double readRectCoord(librevenge::RVNGInputStream *input, bool bigEndian = false);
36 double readCoordinate(librevenge::RVNGInputStream *input, bool bigEndian = false);
37 unsigned readUnsigned(librevenge::RVNGInputStream *input, bool bigEndian = false);
38 unsigned short readUnsignedShort(librevenge::RVNGInputStream *input, bool bigEndian = false);
39 int readInteger(librevenge::RVNGInputStream *input, bool bigEndian = false);
40 double readAngle(librevenge::RVNGInputStream *input, bool bigEndian = false);
41
42 void processPath(const std::vector<std::pair<double, double> > &points, const std::vector<unsigned char> &types, CDRPath &path);
43 void outputPath(const std::vector<std::pair<double, double> > &points, const std::vector<unsigned char> &types);
44
45 CDRCollector *m_collector;
46 CoordinatePrecision m_precision;
47 };
48 } // namespace libcdr
49
50 #endif // __COMMONPARSER_H__
51 /* vim:set shiftwidth=2 softtabstop=2 expandtab: */
libcdr::CommonParser
Definition: CommonParser.h:22
libcdr::CommonParser::processPath
void processPath(const std::vector< std::pair< double, double > > &points, const std::vector< unsigned char > &types, CDRPath &path)
Definition: CommonParser.cpp:78
libcdr::CDRPath
Definition: CDRPath.h:34
libcdr::CommonParser::readCoordinate
double readCoordinate(librevenge::RVNGInputStream *input, bool bigEndian=false)
Definition: CommonParser.cpp:25
libcdr::CommonParser::m_collector
CDRCollector * m_collector
Definition: CommonParser.h:45
libcdr::CommonParser::readUnsigned
unsigned readUnsigned(librevenge::RVNGInputStream *input, bool bigEndian=false)
Definition: CommonParser.cpp:34
libcdr::PRECISION_UNKNOWN
Definition: CommonParser.h:20
libcdr::CommonParser::operator=
CommonParser & operator=(const CommonParser &)
libcdr::CommonParser::readRectCoord
double readRectCoord(librevenge::RVNGInputStream *input, bool bigEndian=false)
libcdr::PRECISION_32BIT
Definition: CommonParser.h:20
libcdr::CoordinatePrecision
CoordinatePrecision
Definition: CommonParser.h:19
libcdr::CommonParser::outputPath
void outputPath(const std::vector< std::pair< double, double > > &points, const std::vector< unsigned char > &types)
Definition: CommonParser.cpp:70
libcdr
Definition: CDRCollector.h:29
libcdr::CommonParser::m_precision
CoordinatePrecision m_precision
Definition: CommonParser.h:46
libcdr::CommonParser::readAngle
double readAngle(librevenge::RVNGInputStream *input, bool bigEndian=false)
Definition: CommonParser.cpp:61
libcdr::CommonParser::readInteger
int readInteger(librevenge::RVNGInputStream *input, bool bigEndian=false)
Definition: CommonParser.cpp:52
libcdr::CommonParser::readUnsignedShort
unsigned short readUnsignedShort(librevenge::RVNGInputStream *input, bool bigEndian=false)
Definition: CommonParser.cpp:43
CDRCollector.h
libcdr::PRECISION_16BIT
Definition: CommonParser.h:20
libcdr::CommonParser::~CommonParser
virtual ~CommonParser()
Definition: CommonParser.cpp:21
CDRPath.h
libcdr::CommonParser::CommonParser
CommonParser()
libcdr::CDRCollector
Definition: CDRCollector.h:59