#include <Iguana/Utilities/classlib/utils/StringOps.h>
Public Types | |
typedef std::vector< int > | FieldList |
enum | FieldOption { TrimEmpty = 1, KeepLeadingEmpty = 2, KeepTrailingEmpty = 4, CaseInsensitiveSep = 8 } |
Options for separator handling in split() and section(). More... | |
Static Public Member Functions | |
static int | contains (const std::string &s, const Regexp &rx) |
static int | contains (const char *s, const Regexp &rx) |
static int | contains (const std::string &s, const std::string &what, bool caseless=false) |
static int | contains (const char *s, const char *what, bool caseless=false) |
static int | contains (const std::string &s, char what, bool caseless=false) |
static int | contains (const char *s, char what, bool caseless=false) |
static int | find (const std::string &s, const Regexp &r, int offset=0) |
static int | find (const char *s, const Regexp &r, int offset=0) |
static int | find (const std::string &s, const std::string &what, int offset=0, bool caseless=false) |
static int | find (const char *s, const char *what, int offset=0, bool caseless=false) |
static int | find (const std::string &s, char what, int offset=0, bool caseless=false) |
static int | find (const char *s, char what, int offset=0, bool caseless=false) |
static StringList | grep (const StringList &items, const Regexp &rx) |
static StringList | grep (const StringList &items, const std::string &str, bool caseless=false) |
static std::string | join (const StringList &items, const std::string &sep) |
static std::string | remove (const std::string &s, const Regexp &what, int offset=0) |
static std::string | remove (const char *s, const Regexp &what, int offset=0) |
static std::string | remove (const std::string &s, const std::string &what, int offset=0) |
static std::string | remove (const char *s, const char *what, int offset=0) |
static std::string | remove (const std::string &s, char what, int offset=0) |
static std::string | remove (const char *s, char what, int offset=0) |
static std::string | replace (const std::string &s, const RegexpMatch &matches, const std::string &pattern) |
static std::string | replace (const char *s, const RegexpMatch &matches, const char *pattern) |
static std::string | replace (const std::string &s, int offset, const Regexp &what, unsigned options, const std::string &with) |
static std::string | replace (const char *s, int offset, const Regexp &what, unsigned options, const char *with) |
static std::string | replace (const std::string &s, int offset, const Regexp &what, const std::string &with) |
static std::string | replace (const char *s, int offset, const Regexp &what, const char *with) |
static std::string | replace (const std::string &s, const Regexp &what, unsigned options, const std::string &with) |
static std::string | replace (const char *s, const Regexp &what, unsigned options, const char *with) |
static std::string | replace (const std::string &s, const Regexp &what, const std::string &with) |
static std::string | replace (const char *s, const Regexp &what, const char *with) |
static std::string | replace (const std::string &s, int offset, const std::string &what, const std::string &with) |
static std::string | replace (const char *s, int offset, const char *what, const char *with) |
static std::string | replace (const std::string &s, const std::string &what, const std::string &with) |
static std::string | replace (const char *s, const char *what, const char *with) |
static std::string | replace (const std::string &s, int offset, char what, const std::string &with) |
static std::string | replace (const char *s, int offset, char what, const char *with) |
static std::string | replace (const std::string &s, char what, const std::string &with) |
static std::string | replace (const char *s, char what, const char *with) |
static int | rfind (const std::string &s, const Regexp &r, int offset=-1) |
static int | rfind (const char *s, const Regexp &r, int offset=-1) |
static int | rfind (const std::string &s, const std::string &what, int offset=-1, bool caseless=false) |
static int | rfind (const char *s, const char *what, int offset=-1, bool caseless=false) |
static int | rfind (const std::string &s, char what, int offset=-1, bool caseless=false) |
static int | rfind (const char *s, char what, int offset=-1, bool caseless=false) |
static std::string | section (const std::string &s, const Regexp &sep, int first, int last=-1, int flags=0) |
static std::string | section (const char *s, const Regexp &sep, int first, int last=-1, int flags=0) |
static std::string | section (const std::string &s, const std::string &sep, int first, int last=-1, int flags=0) |
static std::string | section (const char *s, const char *sep, int first, int last=-1, int flags=0) |
static std::string | section (const std::string &s, char sep, int first, int last=-1, int flags=0) |
static std::string | section (const char *s, char sep, int first, int last=-1, int flags=0) |
static StringList | split (const std::string &s, const Regexp &sep, int flags=0, int nmax=0, int first=0, int last=0) |
static StringList | split (const char *s, const Regexp &sep, int flags=0, int nmax=0, int first=0, int last=0) |
static StringList | split (const std::string &s, const std::string &sep, int flags=0, int nmax=0, int first=0, int last=0) |
static StringList | split (const char *s, const char *sep, int flags=0, int nmax=0, int first=0, int last=0) |
static StringList | split (const std::string &s, char sep, int flags=0, int nmax=0, int first=0, int last=0) |
static StringList | split (const char *s, char sep, int flags=0, int nmax=0, int first=0, int last=0) |
Static Private Member Functions | |
static int | imemcmp (const char *x, const char *y, size_t len) |
static int | rawfind (const char *s, size_t slen, const char *what, size_t len, int offset=0, bool caseless=false) |
static int | rawfind (const char *s, size_t slen, char what, int offset=0, bool caseless=false) |
static int | rawrfind (const char *s, size_t slen, const char *what, size_t len, int offset, bool caseless=false) |
static int | rawrfind (const char *s, size_t slen, char what, int offset, bool caseless=false) |
static std::string | section (const char *s, size_t slen, const FieldList &fields, int first, int last) |
static StringList | split (const char *s, size_t slen, const FieldList &fields, int nmax, int first, int last) |
static size_t | splitmax (int nmax, int first, int last) |
static FieldList | splitpos (const char *s, size_t slen, const Regexp &rx, int flags, size_t nmax) |
static FieldList | splitpos (const char *s, size_t slen, char sep, int flags, size_t nmax) |
static FieldList | splitpos (const char *s, size_t slen, const char *sep, size_t seplen, int flags, size_t nmax) |
Definition at line 22 of file StringOps.h.
typedef std::vector<int> lat::StringOps::FieldList |
Definition at line 25 of file StringOps.h.
Options for separator handling in split() and section().
The default (no options) for split() is that empty fields are allowed, all field separators matter and separator is matched case-sensitively. The default for section() is to ignore leading and trailing empty fields (i.e. initial and trailing separators) but to allow empty internal fields, and to match the separator case-sensitively.
TrimEmpty |
Trim away all empty fields.
|
KeepLeadingEmpty |
Keep leading empty fields.
This is meaningful with split() only when combined with TrimEmpty. |
KeepTrailingEmpty |
Keep trailing empty fields.
This is meaningful with split() only when combined with TrimEmpty. |
CaseInsensitiveSep |
Ignore case when matching the separator.
This option is not meaningful with regular expressions since case handling is defined when constructing the regexp. |
Definition at line 34 of file StringOps.h.
00034 { 00036 TrimEmpty = 1, 00037 00040 KeepLeadingEmpty = 2, 00041 00044 KeepTrailingEmpty = 4, 00045 00049 CaseInsensitiveSep = 8 00050 };
static int lat::StringOps::contains | ( | const std::string & | s, | |
const std::string & | what, | |||
bool | caseless = false | |||
) | [static] |
static int lat::StringOps::contains | ( | const char * | s, | |
const char * | what, | |||
bool | caseless = false | |||
) | [static] |
static int lat::StringOps::contains | ( | const std::string & | s, | |
char | what, | |||
bool | caseless = false | |||
) | [static] |
static int lat::StringOps::find | ( | const std::string & | s, | |
const Regexp & | r, | |||
int | offset = 0 | |||
) | [static] |
static int lat::StringOps::find | ( | const std::string & | s, | |
const std::string & | what, | |||
int | offset = 0 , |
|||
bool | caseless = false | |||
) | [static] |
static int lat::StringOps::find | ( | const char * | s, | |
const char * | what, | |||
int | offset = 0 , |
|||
bool | caseless = false | |||
) | [static] |
static int lat::StringOps::find | ( | const std::string & | s, | |
char | what, | |||
int | offset = 0 , |
|||
bool | caseless = false | |||
) | [static] |
static int lat::StringOps::find | ( | const char * | s, | |
char | what, | |||
int | offset = 0 , |
|||
bool | caseless = false | |||
) | [static] |
Referenced by IgApplication::dumpDatabase().
static StringList lat::StringOps::grep | ( | const StringList & | items, | |
const Regexp & | rx | |||
) | [static] |
static StringList lat::StringOps::grep | ( | const StringList & | items, | |
const std::string & | str, | |||
bool | caseless = false | |||
) | [static] |
static int lat::StringOps::imemcmp | ( | const char * | x, | |
const char * | y, | |||
size_t | len | |||
) | [static, private] |
static std::string lat::StringOps::join | ( | const StringList & | items, | |
const std::string & | sep | |||
) | [static] |
static int lat::StringOps::rawfind | ( | const char * | s, | |
size_t | slen, | |||
const char * | what, | |||
size_t | len, | |||
int | offset = 0 , |
|||
bool | caseless = false | |||
) | [static, private] |
static int lat::StringOps::rawfind | ( | const char * | s, | |
size_t | slen, | |||
char | what, | |||
int | offset = 0 , |
|||
bool | caseless = false | |||
) | [static, private] |
static int lat::StringOps::rawrfind | ( | const char * | s, | |
size_t | slen, | |||
const char * | what, | |||
size_t | len, | |||
int | offset, | |||
bool | caseless = false | |||
) | [static, private] |
static int lat::StringOps::rawrfind | ( | const char * | s, | |
size_t | slen, | |||
char | what, | |||
int | offset, | |||
bool | caseless = false | |||
) | [static, private] |
static std::string lat::StringOps::remove | ( | const std::string & | s, | |
const Regexp & | what, | |||
int | offset = 0 | |||
) | [static] |
static std::string lat::StringOps::remove | ( | const char * | s, | |
const Regexp & | what, | |||
int | offset = 0 | |||
) | [static] |
static std::string lat::StringOps::remove | ( | const std::string & | s, | |
const std::string & | what, | |||
int | offset = 0 | |||
) | [static] |
static std::string lat::StringOps::remove | ( | const char * | s, | |
const char * | what, | |||
int | offset = 0 | |||
) | [static] |
static std::string lat::StringOps::remove | ( | const std::string & | s, | |
char | what, | |||
int | offset = 0 | |||
) | [static] |
static std::string lat::StringOps::remove | ( | const char * | s, | |
char | what, | |||
int | offset = 0 | |||
) | [static] |
static std::string lat::StringOps::replace | ( | const std::string & | s, | |
const RegexpMatch & | matches, | |||
const std::string & | pattern | |||
) | [static] |
static std::string lat::StringOps::replace | ( | const char * | s, | |
const RegexpMatch & | matches, | |||
const char * | pattern | |||
) | [static] |
static std::string lat::StringOps::replace | ( | const std::string & | s, | |
int | offset, | |||
const Regexp & | what, | |||
unsigned | options, | |||
const std::string & | with | |||
) | [static] |
static std::string lat::StringOps::replace | ( | const char * | s, | |
int | offset, | |||
const Regexp & | what, | |||
unsigned | options, | |||
const char * | with | |||
) | [static] |
static std::string lat::StringOps::replace | ( | const std::string & | s, | |
int | offset, | |||
const Regexp & | what, | |||
const std::string & | with | |||
) | [static] |
static std::string lat::StringOps::replace | ( | const char * | s, | |
int | offset, | |||
const Regexp & | what, | |||
const char * | with | |||
) | [static] |
static std::string lat::StringOps::replace | ( | const std::string & | s, | |
const Regexp & | what, | |||
unsigned | options, | |||
const std::string & | with | |||
) | [static] |
static std::string lat::StringOps::replace | ( | const char * | s, | |
const Regexp & | what, | |||
unsigned | options, | |||
const char * | with | |||
) | [static] |
static std::string lat::StringOps::replace | ( | const std::string & | s, | |
const Regexp & | what, | |||
const std::string & | with | |||
) | [static] |
static std::string lat::StringOps::replace | ( | const char * | s, | |
const Regexp & | what, | |||
const char * | with | |||
) | [static] |
static std::string lat::StringOps::replace | ( | const std::string & | s, | |
int | offset, | |||
const std::string & | what, | |||
const std::string & | with | |||
) | [static] |
static std::string lat::StringOps::replace | ( | const char * | s, | |
int | offset, | |||
const char * | what, | |||
const char * | with | |||
) | [static] |
static std::string lat::StringOps::replace | ( | const std::string & | s, | |
const std::string & | what, | |||
const std::string & | with | |||
) | [static] |
static std::string lat::StringOps::replace | ( | const char * | s, | |
const char * | what, | |||
const char * | with | |||
) | [static] |
static std::string lat::StringOps::replace | ( | const std::string & | s, | |
int | offset, | |||
char | what, | |||
const std::string & | with | |||
) | [static] |
static std::string lat::StringOps::replace | ( | const char * | s, | |
int | offset, | |||
char | what, | |||
const char * | with | |||
) | [static] |
static std::string lat::StringOps::replace | ( | const std::string & | s, | |
char | what, | |||
const std::string & | with | |||
) | [static] |
static std::string lat::StringOps::replace | ( | const char * | s, | |
char | what, | |||
const char * | with | |||
) | [static] |
Referenced by IgApplication::pluginFeedback(), and DQMStore::save().
static int lat::StringOps::rfind | ( | const std::string & | s, | |
const Regexp & | r, | |||
int | offset = -1 | |||
) | [static] |
static int lat::StringOps::rfind | ( | const std::string & | s, | |
const std::string & | what, | |||
int | offset = -1 , |
|||
bool | caseless = false | |||
) | [static] |
static int lat::StringOps::rfind | ( | const char * | s, | |
const char * | what, | |||
int | offset = -1 , |
|||
bool | caseless = false | |||
) | [static] |
static int lat::StringOps::rfind | ( | const std::string & | s, | |
char | what, | |||
int | offset = -1 , |
|||
bool | caseless = false | |||
) | [static] |
static int lat::StringOps::rfind | ( | const char * | s, | |
char | what, | |||
int | offset = -1 , |
|||
bool | caseless = false | |||
) | [static] |
static std::string lat::StringOps::section | ( | const char * | s, | |
size_t | slen, | |||
const FieldList & | fields, | |||
int | first, | |||
int | last | |||
) | [static, private] |
static std::string lat::StringOps::section | ( | const std::string & | s, | |
const Regexp & | sep, | |||
int | first, | |||
int | last = -1 , |
|||
int | flags = 0 | |||
) | [static] |
static std::string lat::StringOps::section | ( | const char * | s, | |
const Regexp & | sep, | |||
int | first, | |||
int | last = -1 , |
|||
int | flags = 0 | |||
) | [static] |
static std::string lat::StringOps::section | ( | const std::string & | s, | |
const std::string & | sep, | |||
int | first, | |||
int | last = -1 , |
|||
int | flags = 0 | |||
) | [static] |
static std::string lat::StringOps::section | ( | const char * | s, | |
const char * | sep, | |||
int | first, | |||
int | last = -1 , |
|||
int | flags = 0 | |||
) | [static] |
static std::string lat::StringOps::section | ( | const std::string & | s, | |
char | sep, | |||
int | first, | |||
int | last = -1 , |
|||
int | flags = 0 | |||
) | [static] |
static std::string lat::StringOps::section | ( | const char * | s, | |
char | sep, | |||
int | first, | |||
int | last = -1 , |
|||
int | flags = 0 | |||
) | [static] |
static StringList lat::StringOps::split | ( | const char * | s, | |
size_t | slen, | |||
const FieldList & | fields, | |||
int | nmax, | |||
int | first, | |||
int | last | |||
) | [static, private] |
static StringList lat::StringOps::split | ( | const std::string & | s, | |
const Regexp & | sep, | |||
int | flags = 0 , |
|||
int | nmax = 0 , |
|||
int | first = 0 , |
|||
int | last = 0 | |||
) | [static] |
static StringList lat::StringOps::split | ( | const char * | s, | |
const Regexp & | sep, | |||
int | flags = 0 , |
|||
int | nmax = 0 , |
|||
int | first = 0 , |
|||
int | last = 0 | |||
) | [static] |
static StringList lat::StringOps::split | ( | const std::string & | s, | |
const std::string & | sep, | |||
int | flags = 0 , |
|||
int | nmax = 0 , |
|||
int | first = 0 , |
|||
int | last = 0 | |||
) | [static] |
static StringList lat::StringOps::split | ( | const char * | s, | |
const char * | sep, | |||
int | flags = 0 , |
|||
int | nmax = 0 , |
|||
int | first = 0 , |
|||
int | last = 0 | |||
) | [static] |
static StringList lat::StringOps::split | ( | const std::string & | s, | |
char | sep, | |||
int | flags = 0 , |
|||
int | nmax = 0 , |
|||
int | first = 0 , |
|||
int | last = 0 | |||
) | [static] |
static StringList lat::StringOps::split | ( | const char * | s, | |
char | sep, | |||
int | flags = 0 , |
|||
int | nmax = 0 , |
|||
int | first = 0 , |
|||
int | last = 0 | |||
) | [static] |
Referenced by Ig2DModel::Ig2DModel().
static FieldList lat::StringOps::splitpos | ( | const char * | s, | |
size_t | slen, | |||
const Regexp & | rx, | |||
int | flags, | |||
size_t | nmax | |||
) | [static, private] |
static FieldList lat::StringOps::splitpos | ( | const char * | s, | |
size_t | slen, | |||
char | sep, | |||
int | flags, | |||
size_t | nmax | |||
) | [static, private] |
static FieldList lat::StringOps::splitpos | ( | const char * | s, | |
size_t | slen, | |||
const char * | sep, | |||
size_t | seplen, | |||
int | flags, | |||
size_t | nmax | |||
) | [static, private] |