00001 #ifndef IOF_VALIDITY_HPP_
00002 #define IOF_VALIDITY_HPP_
00003
00016 #include <string>
00017
00018
00019 namespace iof
00020 {
00021
00022
00036 struct validity
00037 {
00038 int problemPos;
00039 std::string fmt;
00040
00041 validity(): problemPos(-1) {}
00042 void set(const char* problemPos_, const std::string& fmtStr)
00043 {
00044 problemPos = (problemPos_ ? int(problemPos_ - fmtStr.c_str()) : -1);
00045 fmt = fmtStr;
00046 }
00047
00049 operator bool() const {return problemPos < 0;}
00050 bool operator!() const {return problemPos >= 0;}
00051 };
00052
00053
00054 }
00055
00056
00057 #endif // IOF_VALIDITY_HPP_