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