environmentCodec.h

Go to the documentation of this file.
00001 #ifndef ENVIRONMENT_CODEC_H
00002 #define ENVIRONMENT_CODEC_H
00003 
00013 #include "coordinateCtrl.h"
00014 #include <deque>
00015 
00016 
00020 class EnvironmentCodecStream {
00021 
00025   virtual char get1ch(void) = 0;
00026   void ungetch(void);
00027 
00028 public:
00029   enum { Fail = -1, Complete = 0, All = -1, };
00030   std::deque<char> buffer;      
00032   virtual ~EnvironmentCodecStream(void) {}
00033 
00039   virtual bool is_open(void) = 0;
00040 
00046   virtual bool eof(void) = 0;
00047 
00053   void read1ch(void);
00054 
00062   void clearBuffer(int n = All);
00063 };
00064 
00065 
00069 extern int encodeLineFeedFromText(EnvironmentCodecStream& codec, int offset);
00070 
00074 extern int encodeSpaceFromText(EnvironmentCodecStream& codec, int offset,
00075                                int require_size = 0);
00076 
00080 extern int encodeNumericFromText(EnvironmentCodecStream& codec, int offset,
00081                                  int* numeric);
00082 
00086 extern int encodeAPointFromText(EnvironmentCodecStream& codec, int offset,
00087                                 VXV::Grid3D& point);
00088 
00092 extern int encodePointsFromText(EnvironmentCodecStream& codec, int offset,
00093                                 std::vector<VXV::Grid3D>& points);
00094 
00098 extern int encodePolygonFromText(EnvironmentCodecStream& codec, int offset,
00099                                  std::vector<CoordinateCtrl::polygon_t>&
00100                                  polygons);
00101 
00102 #endif /* !ENVIRONMENT_CODEC_H */
00103 

Generated on Mon Apr 13 22:52:03 2009 by  doxygen 1.5.7.1