00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022 #ifndef TagRetrievalPos_h
00023 #define TagRetrievalPos_h
00024
00025 #include <iostream>
00026 #include <string>
00027 #include <list>
00028
00030
00031
00032
00033 class TagRetrievalPos {
00034 private:
00035 std::streamoff _begin;
00036 std::streamoff _end;
00037
00038
00039 int positionStream (std::istream & stream_fr) const;
00040
00041 static const unsigned bufferLen_i;
00042 static char buffer_ac[];
00043
00044 public:
00045 static const std::streamoff nopos;
00046 TagRetrievalPos () : _begin(nopos), _end (nopos) {}
00047 TagRetrievalPos (std::streamoff begin, std::streamoff end) : _begin(begin), _end (end) {}
00048 ~TagRetrievalPos() {}
00049
00053 bool empty () const { return _end == nopos; }
00054
00058 const std::streamoff begin() const { return _begin; }
00059 const std::streamoff end() const { return _end; }
00060
00064 void set (std::streamoff begin, std::streamoff end) {
00065 if ( begin < end ) {
00066 _begin = begin;
00067 _end = end;
00068 }
00069 }
00070
00074 bool retrieveData (std::istream& input, std::string& data_r) const;
00075
00079 bool retrieveData (std::istream& input, std::list<std::string>& data_r) const;
00080 };
00081
00082 #endif // TagRetrievalPos_h