00001 #include "std_cpp_includes.hh"
00002
00009 template<typename T>
00010 std::string findit(std::string arg, char sep, size_t & pos, T & thingie, int & ierr) {
00011 std::string ret = "";
00012
00013 if (pos >= arg.size()) { return ret; }
00014
00015 if (arg[pos]==sep) pos++;
00016
00017 size_t posc=pos;
00018
00019 while (pos < arg.size() && arg[pos] != sep) pos++;
00020
00021 ret = arg.substr(posc,pos-posc);
00022
00023 stringstream alpha;
00024 if (ret != "") alpha << ret;
00025 alpha >> thingie;
00026
00027 ierr=0;
00028 if ( (alpha.rdstate() & std::ifstream::failbit ) != 0 ) ierr=1;
00029
00030 return ret;
00031 }
00032
00033