38 #ifndef TF_RANGESTRING_H_VERSION 40 #define TF_RANGESTRING_H_VERSION \ 41 "TF_RANGESTRING_H V1.2" 43 #include<tfxx/range.h> 44 #include<tfxx/rangelist.h> 45 #include<tfxx/stringfunc.h> 64 typename Trange::Tvalue v1, v2;
65 std::list<std::string> slist;
67 std::list<std::string>::const_iterator i=slist.begin();
68 std::istringstream iss(*i);
103 std::list<std::string> slist;
105 std::list<std::string>::const_iterator i=slist.begin();
106 while (i!=slist.end())
108 std::vector<std::string> svec;
112 std::vector<std::string> svec2;
114 TFXX_assert(svec2.size()>1,
"range not properly defined");
115 typename Trange::Tvalue start(0), step(0), end(0);
116 { std::istringstream iss(svec[0]); iss >> start; }
117 { std::istringstream iss(svec2[0]); iss >> step; }
118 { std::istringstream iss(svec2[1]); iss >> end; }
127 TFXX_assert(step>0,
"range step size must be positive");
128 for (
typename Trange::Tvalue j=start; j<=end; j=j+step)
130 retval.append(Trange(j,j));
136 retval.append(range<typename Tlist::Tvalue>(*i));
147 #endif // TF_RANGESTRING_H_VERSION (includeguard) #define TFXX_assert(C, M)
Check an assertion and report by throwing an exception.
tfxx::Range< T > range(const std::string &s)
A class to deal with numerical ranges.
void gen_split(C &v, const std::string &s, const std::string &delimiter=" ", const bool &dropdelimiter=false)
tfxx::RangeList< T > rangelist(const std::string &s)
Namespace containing all code of library libtfxx.