#include <SheppStrUtil.H>
Static Public Member Functions | |
static char * | trim (char *line) |
Removes leading and ending white spaces from line (shepp). | |
static vector< string > | parse_line (char *line) |
Given a line, split its words by white space into a string vector (shepp). | |
static int | split (string input, string &first, string &second, string splitter, bool relaxed=false) |
static int | quote_gathering (vector< string > &words, string &gather) |
Gathers command-line arguments bounded by quotes in a string. | |
static string | doc2id (const string &doc) |
Removes chars [./-] from document strings. |
static string SheppStrUtil::doc2id | ( | const string & | doc | ) | [inline, static] |
Removes chars [./-] from document strings.
doc | a CPF or CNPJ document |
References StrUtil::gsub().
Referenced by cmd_brorg_check(), cmd_brorg_create(), cmd_brorg_info(), and cmd_brorg_update().
static vector<string> SheppStrUtil::parse_line | ( | char * | line | ) | [inline, static] |
Given a line, split its words by white space into a string vector (shepp).
line | line to be parsed | |
loop | boolean, default true, set to false to get only first word |
Referenced by execute(), and executeInputFile().
static int SheppStrUtil::quote_gathering | ( | vector< string > & | words, | |
string & | gather | |||
) | [inline, static] |
Gathers command-line arguments bounded by quotes in a string.
words | reference to vector with arguments | |
gather | reference to return string |
Referenced by cmd_brorg_create(), cmd_brorg_update(), SheppObjSet::postalInfo(), and SheppObjSet::status().
static int SheppStrUtil::split | ( | string | input, | |
string & | first, | |||
string & | second, | |||
string | splitter, | |||
bool | relaxed = false | |||
) | [inline, static] |
Splits input into first and second at first occurrence of splitter. If relaxed is true, it is acceptable for second to be empty.
input | string to be divided | |
first | left side goes here | |
second | right side goes here | |
splitter | division point | |
relaxed | true means that second can be empty |
Referenced by SheppObjSet::authInfo(), cmd_asn_create(), cmd_asn_renew(), cmd_asn_update(), cmd_brorg_update(), cmd_contact_update(), cmd_domain_create(), cmd_domain_renew(), cmd_domain_update(), cmd_ipnetwork_create(), cmd_ipnetwork_renew(), cmd_ipnetwork_update(), cmd_server(), SheppObjSet::contacts(), SheppObjSet::disclose(), SheppObjSet::nameServer(), parse_iprange(), SheppObjSet::phone(), and SheppObjSet::status().
static char* SheppStrUtil::trim | ( | char * | line | ) | [inline, static] |
Removes leading and ending white spaces from line (shepp).
line | line to be trimmed |
Referenced by executeInputFile(), and main().