SheppStrUtil Class Reference

Useful string manipulation routines used by shepp. More...

#include <SheppStrUtil.H>

List of all members.

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, bool loop=true)
 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.


Detailed Description

Useful string manipulation routines used by shepp.


Member Function Documentation

static string SheppStrUtil::doc2id const string &  doc  )  [inline, static]
 

Removes chars [./-] from document strings.

Parameters:
doc a CPF or CNPJ document
Returns:
input doc with no [./-] characters

static vector<string> SheppStrUtil::parse_line char *  line,
bool  loop = true
[inline, static]
 

Given a line, split its words by white space into a string vector (shepp).

Parameters:
line line to be parsed
loop boolean, default true, set to false to get only first word
Returns:
string vector with all words found in line

static int SheppStrUtil::quote_gathering vector< string > &  words,
string &  gather
[inline, static]
 

Gathers command-line arguments bounded by quotes in a string.

Parameters:
words reference to vector with arguments
gather reference to return string
Returns:
0 if OK, -1 if ERROR

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.

Parameters:
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

static char* SheppStrUtil::trim char *  line  )  [inline, static]
 

Removes leading and ending white spaces from line (shepp).

Parameters:
line line to be trimmed
Returns:
trimmed line


The documentation for this class was generated from the following file:
Generated on Thu Jun 8 17:40:01 2006 for libepp_nicbr by  doxygen 1.4.6