544 static const boost::regex expr(
"[^\\[]([[:word:].]+)(\\[([[:digit:]]+)\\])?");
548 vector<MyColumn> vec;
550 for (
auto it=names.begin(); it!=names.end(); it++)
557 string::const_iterator ibeg = it->begin();
558 string::const_iterator iend = it->end();
561 while (boost::regex_search(ibeg, iend, what, expr, boost::match_extra))
563 const string all = what[0];
564 const string name = what[1];
565 const size_t idx = atol(
string(what[3]).c_str());
568 const auto ic = cols.find(name);
576 if (idx>=ic->second.num)
578 cout <<
"Column '" << name <<
"' has no index " << idx <<
"." << endl;
579 return vector<MyColumn>();
584 for (; p<vec.size(); p++)
585 if (vec[p].name==name)
588 const string id =
'['+to_string(p)+
']';
592 const size_t offset = what[0].first - it->begin();
594 it->replace(ibeg-it->begin()+what.position(1), what.length()-1,
id);
596 ibeg = it->begin() + offset +
id.size();
606 mycol.
col = ic->second;
611 vec.push_back(mycol);
616 id <<
'[' << vec.size() <<
']';
618 for (
auto it=names.begin(); it!=names.end(); it++)
622 auto p = it->find_first_of(
'#');
626 it->replace(p, 1,
id.
str());
void * SetPtrAddress(const std::string &name)
std::map< std::string, Column > Columns
const Table::Columns & GetColumns() const