tgl_list_parser : parse_to_set |
Parse the string out to a set.
Any other method of any other object can call this method. This is called 'public' access.
The data-type returned is "booltype"; Not sure.
This method is contained in the object "tgl_list_parser".
The method takes the following arguments:
str : stringtype
The input list.
s : stringsetptrtype
The string to output.
The namespaces "boost::spirit" are used.
The files "boost/spirit/core.hpp", "boost/spirit/utility/lists.hpp", "insert_action.hpp" and "set" are included.
if (str == "[]" || str == "") return true; rule<> r = // ch_p('[') >> list_p((*anychar_p)[insert(*s)], ',', ']') '[' >> (*(anychar_p - (ch_p(',') | ch_p(']'))))[insert(*s)] >> *(',' >> (*(anychar_p - (ch_p(',') | ch_p(']'))))[insert(*s)]) >> ']' ; // parse_info<> result = parse(str.begin(), str.end(), list_wo_item, space_p); parse_info<> result = parse(str.c_str(), r); return result.hit;