suplibxx  1.3.13
Column Selection

Functions

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. More...
 
bool suplib::match (const std::string &str, const std::string &pattern)
 handles Perl regular expression matching. More...
 

Detailed Description

Function Documentation

◆ colselect()

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.

Parameters
icolumnsvector of column names on which to operate
exact_addcolumn names to add to output
regex_addregular expressions used to add to output
exact_delcolumn names to exclude from output
regex_delregular expressions used to exclude from output
ocolumnsset of column names which were selected
Exceptions
Exceptionerrors 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.

◆ match()

bool suplib::match ( const std::string &  str,
const std::string &  pattern 
)

handles Perl regular expression matching.

Parameters
strthe string
patternthe regular expression pattern with which to compare
Exceptions
Exceptionerrors related to pattern matching

match uses the pcre library's functionality to compare str with pattern.

Returns
true is str matches pattern, false if not.

Definition at line 50 of file match.cc.