Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010 #ifndef __COMMONPARSER_H__
00011 #define __COMMONPARSER_H__
00012
00013 #include "CDRCollector.h"
00014 #include "CDRPath.h"
00015
00016 namespace libcdr
00017 {
00018
00019 enum CoordinatePrecision
00020 { PRECISION_UNKNOWN = 0, PRECISION_16BIT, PRECISION_32BIT };
00021
00022 class CommonParser
00023 {
00024 public:
00025 CommonParser(CDRCollector *collector);
00026 virtual ~CommonParser();
00027
00028 private:
00029 CommonParser();
00030 CommonParser(const CommonParser &);
00031 CommonParser &operator=(const CommonParser &);
00032
00033
00034 protected:
00035 double readRectCoord(librevenge::RVNGInputStream *input, bool bigEndian = false);
00036 double readCoordinate(librevenge::RVNGInputStream *input, bool bigEndian = false);
00037 unsigned readUnsigned(librevenge::RVNGInputStream *input, bool bigEndian = false);
00038 unsigned short readUnsignedShort(librevenge::RVNGInputStream *input, bool bigEndian = false);
00039 int readInteger(librevenge::RVNGInputStream *input, bool bigEndian = false);
00040 double readAngle(librevenge::RVNGInputStream *input, bool bigEndian = false);
00041
00042 void processPath(const std::vector<std::pair<double, double> > &points, const std::vector<unsigned char> &types, CDRPath &path);
00043 void outputPath(const std::vector<std::pair<double, double> > &points, const std::vector<unsigned char> &types);
00044
00045 CDRCollector *m_collector;
00046 CoordinatePrecision m_precision;
00047 };
00048 }
00049
00050 #endif // __COMMONPARSER_H__
00051