suplibxx
1.3.13
|
Functions | |
void | suplib::colselect (const std::vector< std::string > &icolumns, const std::vector< std::string > &exact_add, const std::vector< std::string > ®ex_add, const std::vector< std::string > &exact_del, const std::vector< std::string > ®ex_del, std::vector< std::string > &ocolumns) |
select columns based on exact/regex matching/exclusion. More... | |
bool | suplib::match (const std::string &str, const std::string &pattern) |
handles Perl regular expression matching. More... | |
void suplib::colselect | ( | const std::vector< std::string > & | icolumns, |
const std::vector< std::string > & | exact_add, | ||
const std::vector< std::string > & | regex_add, | ||
const std::vector< std::string > & | exact_del, | ||
const std::vector< std::string > & | regex_del, | ||
std::vector< std::string > & | ocolumns | ||
) |
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.
Definition at line 57 of file colselect.cc.
bool suplib::match | ( | const std::string & | str, |
const std::string & | pattern | ||
) |
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.