205 static const boost::regex expr(
"([[:word:].]+)(\\[([[:digit:]]+)?(:)?([[:digit:]]+)?\\])?");
210 for (
auto it=fColMap.begin(); it!=fColMap.end(); it++)
211 if (it->second.num>0)
212 names.push_back(it->first);
214 vector<MyColumn> vec;
216 for (
auto it=names.begin(); it!=names.end(); it++)
219 if (!boost::regex_match(*it, what, expr, boost::match_extra))
221 cerr <<
"Couldn't parse expression '" << *it <<
"' " << endl;
222 return vector<MyColumn>();
225 const string name = what[1];
227 const auto iter = fColMap.find(name);
228 if (iter==fColMap.end())
230 cerr <<
"ERROR - Column '" << name <<
"' not found in table." << endl;
231 return vector<MyColumn>();
236 const string val0 = what[3];
237 const string delim = what[4];
238 const string val1 = what[5];
240 const uint32_t
first = atol(val0.c_str());
241 const uint32_t last = (val0.empty() && delim.empty()) ? col.num-1 : (val1.empty() ? first : atoi(val1.c_str()));
245 cerr <<
"ERROR - First index " << first <<
" for column " << name <<
" exceeds number of elements " << col.num << endl;
246 return vector<MyColumn>();
251 cerr <<
"ERROR - Last index " << last <<
" for column " << name <<
" exceeds number of elements " << col.num << endl;
252 return vector<MyColumn>();
257 cerr <<
"ERROR - Last index " << last <<
" for column " << name <<
" exceeds first index " << first << endl;
258 return vector<MyColumn>();
269 vec.push_back(mycol);
void * SetPtrAddress(const std::string &name)
std::map< std::string, Column > Columns
int64_t first
Size of this column in the tile.
const Table::Columns & GetColumns() const