mongoutils::str Namespace Reference

Classes

class  stream

Typedefs

typedef std::string string

Functions

string after (string s, string x)
const char * after (const char *s, const char *x)
string after (const string &s, char x)
const char * after (const char *s, char x)
string before (const string &s, const string &x)
string before (const string &s, char x)
bool contains (string s, char x)
bool contains (string s, string x)
unsigned count (const string &s, char c)
bool endsWith (string s, string p)
bool equals (const char *a, const char *b)
string ltrim (const string &s)
bool rSplitOn (const string &s, char c, string &L, string &R)
int shareCommonPrefix (const string &a, const string &b)
int shareCommonPrefix (const char *p, const char *q)
bool splitOn (const string &s, char c, string &L, string &R)
bool startsWith (string s, string p)
bool startsWith (const char *str, const char *prefix)
void stripTrailing (string &s, const char *chars)
unsigned toUnsigned (const string &a)

Typedef Documentation

typedef std::string mongoutils::str::string

Definition at line 38 of file str.h.


Function Documentation

string mongoutils::str::after ( string  s,
string  x 
) [inline]

Definition at line 96 of file str.h.

const char* mongoutils::str::after ( const char *  s,
const char *  x 
) [inline]

find string x, and return rest of string thereafter, or "" if not found

Definition at line 92 of file str.h.

string mongoutils::str::after ( const string &  s,
char  x 
) [inline]

Definition at line 86 of file str.h.

const char* mongoutils::str::after ( const char *  s,
char  x 
) [inline]

find char x, and return rest of string thereafter, or "" if not found

Definition at line 82 of file str.h.

string mongoutils::str::before ( const string &  s,
const string &  x 
) [inline]
Returns:
everything befor the string x, else entire string

Definition at line 116 of file str.h.

string mongoutils::str::before ( const string &  s,
char  x 
) [inline]
Returns:
everything befor the character x, else entire string

Definition at line 110 of file str.h.

bool mongoutils::str::contains ( string  s,
char  x 
) [inline]

Definition at line 105 of file str.h.

bool mongoutils::str::contains ( string  s,
string  x 
) [inline]
Returns:
true if s contains x

Definition at line 102 of file str.h.

unsigned mongoutils::str::count ( const string &  s,
char  c 
) [inline]
Returns:
number of occurrences of c in s

Definition at line 180 of file str.h.

bool mongoutils::str::endsWith ( string  s,
string  p 
) [inline]

Definition at line 72 of file str.h.

bool mongoutils::str::equals ( const char *  a,
const char *  b 
) [inline]

Definition at line 79 of file str.h.

string mongoutils::str::ltrim ( const string &  s  )  [inline]

trim leading spaces. spaces only, not tabs etc.

Definition at line 189 of file str.h.

bool mongoutils::str::rSplitOn ( const string &  s,
char  c,
string &  L,
string &  R 
) [inline]

split scanning reverse direction. Splits ONCE ONLY.

Definition at line 167 of file str.h.

int mongoutils::str::shareCommonPrefix ( const string &  a,
const string &  b 
) [inline]

Definition at line 134 of file str.h.

int mongoutils::str::shareCommonPrefix ( const char *  p,
const char *  q 
) [inline]

check if if strings share a common starting prefix

Returns:
offset of divergence (or length if equal). 0=nothing in common.

Definition at line 123 of file str.h.

bool mongoutils::str::splitOn ( const string &  s,
char  c,
string &  L,
string &  R 
) [inline]

split a string on a specific char. We don't split N times, just once on the first occurrence. If char not present entire string is in L and R is empty.

Returns:
true if char found

Definition at line 155 of file str.h.

bool mongoutils::str::startsWith ( string  s,
string  p 
) [inline]

Definition at line 70 of file str.h.

bool mongoutils::str::startsWith ( const char *  str,
const char *  prefix 
) [inline]

Definition at line 61 of file str.h.

void mongoutils::str::stripTrailing ( string &  s,
const char *  chars 
) [inline]

remove trailing chars in place

Definition at line 196 of file str.h.

unsigned mongoutils::str::toUnsigned ( const string &  a  )  [inline]

string to unsigned. zero if not a number. can end with non-num chars

Definition at line 138 of file str.h.

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines


mongodb
Author(s): Nate Koenig
autogenerated on Fri Jan 11 12:15:59 2013