Functions | |
void | suplib::colselect (const vector< string > &icolumns, const vector< string > &exact_add, const vector< string > ®ex_add, const vector< string > &exact_del, const vector< string > ®ex_del, vector< string > &ocolumns) throw ( Exception ) |
select columns based on exact/regex matching/exclusion. | |
bool | suplib::match (const string &str, const string &pattern) throw ( Exception ) |
handles Perl regular expression matching. |
void suplib::colselect | ( | const vector< string > & | icolumns, | |
const vector< string > & | exact_add, | |||
const vector< string > & | regex_add, | |||
const vector< string > & | exact_del, | |||
const vector< string > & | regex_del, | |||
vector< string > & | ocolumns | |||
) | throw ( Exception ) |
select columns based on exact/regex matching/exclusion.
icolumns | vector of column names on which to operate | |
exact_add | column names to add to output | |
regex_add | regular expressions used to add to output | |
exact_del | column names to exclude from output | |
regex_del | regular expressions used to exclude from output | |
ocolumns | set of column names which were selected |
Exception | errors related to pattern matching |
colselect places strings from the input vector in the output vector based on matches specified by the parameters. Strings appearing in the exact_del parameter are excluded from the output vector. Strings which match the regular expression in regex_del are excluded from the output vector. Strings which do not match any of the *_del parameters but are either present in exact_add or match a regular expression in regex_add are added to the output set.
bool suplib::match | ( | const string & | str, | |
const string & | pattern | |||
) | throw ( Exception ) |
handles Perl regular expression matching.
str | the string | |
pattern | the regular expression pattern with which to compare |
Exception | errors related to pattern matching |
match uses the pcre library's functionality to compare str with pattern.