nis-util
1.0.D108
|
#include <rcstring.h>
Data Structures | |
class | string_ty |
Public Types | |
typedef unsigned long | hash_ty |
Public Member Functions | |
virtual | ~rcstring () |
rcstring () | |
rcstring (const char *s) | |
rcstring (const char *s, size_t len) | |
rcstring (const rcstring &arg) | |
rcstring & | operator= (const rcstring &arg) |
const char * | c_str (void) const |
hash_ty | get_hash (void) const |
rcstring | trim_right (void) const |
bool | is_printable (void) const |
bool | is_lower_case (void) const |
bool | starts_with (const rcstring &prefix) const |
bool | ends_with (const rcstring &suffix) const |
rcstring | replace (const rcstring &from, const rcstring &to, size_t ntimes) const |
unsigned char | front (void) const |
unsigned char | back (void) const |
rcstring | basename (void) const |
rcstring | dirname (void) const |
rcstring | identifier (void) const |
rcstring | trim (void) const |
rcstring | upcase (void) const |
rcstring | downcase (void) const |
bool | operator== (const rcstring &rhs) const |
bool | operator!= (const rcstring &rhs) const |
static rcstring static rcstring bool | empty (void) const |
size_t | size (void) const |
std::vector< rcstring > | break_up (const char *sep=0, bool ignsp=true) const |
rcstring | substr (size_t start, size_t len) const |
bool | to_long (long &n, int base=10) const |
rcstring & | operator+= (const rcstring &arg) |
rcstring | quote_c (void) const |
rcstring | quote_shell (void) const |
char | operator[] (int idx) const |
Static Public Member Functions | |
static rcstring | spaces (size_t n) |
static rcstring | format (const char *,...) ATTRIBUTE_PRINTF(1 |
static rcstring static rcstring | vformat (const char *, va_list) ATTRIBUTE_VPRINTF(1 |
static rcstring | catenate (const rcstring &, const rcstring &) |
Private Attributes | |
string_ty * | value |
Definition at line 28 of file rcstring.h.
typedef unsigned long rcstring::hash_ty |
Definition at line 94 of file rcstring.h.
virtual rcstring::~rcstring | ( | ) | [inline, virtual] |
The destructor.
Definition at line 34 of file rcstring.h.
rcstring::rcstring | ( | ) | [inline] |
The default constructor.
Definition at line 42 of file rcstring.h.
rcstring::rcstring | ( | const char * | s | ) | [inline] |
A constructor.
Definition at line 50 of file rcstring.h.
rcstring::rcstring | ( | const char * | s, |
size_t | len | ||
) | [inline] |
A constructor.
Definition at line 58 of file rcstring.h.
rcstring::rcstring | ( | const rcstring & | arg | ) | [inline] |
The copy constructor.
Definition at line 66 of file rcstring.h.
unsigned char rcstring::back | ( | void | ) | const |
rcstring rcstring::basename | ( | void | ) | const |
The basename method is used to create a new string by extracting the final path component.
Definition at line 25 of file basename.cc.
std::vector< rcstring > rcstring::break_up | ( | const char * | sep = 0 , |
bool | ignsp = true |
||
) | const |
The break_up method is used to break the string into component fields, separated by `separtor' characters.
Definition at line 375 of file rcstring.cc.
const char* rcstring::c_str | ( | void | ) | const [inline] |
Definition at line 88 of file rcstring.h.
rcstring rcstring::catenate | ( | const rcstring & | lhs, |
const rcstring & | rhs | ||
) | [static] |
The catenate method is used to join two strings end-to-end to produce a new string.
Definition at line 247 of file rcstring.cc.
rcstring rcstring::dirname | ( | void | ) | const |
The dirname method is used to create a new string by omitting the final path component.
Definition at line 25 of file dirname.cc.
rcstring rcstring::downcase | ( | void | ) | const |
Turn the string into lower case.
Definition at line 314 of file rcstring.cc.
static rcstring static rcstring bool rcstring::empty | ( | void | ) | const [inline] |
Definition at line 325 of file rcstring.h.
bool rcstring::ends_with | ( | const rcstring & | suffix | ) | const |
The ends_with method is used to determine whether or not this string ends with the given suffix.
Definition at line 25 of file ends_with.cc.
rcstring rcstring::format | ( | const char * | fmt, |
... | |||
) | [static] |
Definition at line 339 of file rcstring.cc.
unsigned char rcstring::front | ( | void | ) | const |
hash_ty rcstring::get_hash | ( | void | ) | const [inline] |
Definition at line 97 of file rcstring.h.
rcstring rcstring::identifier | ( | void | ) | const |
The identifier method is used to create a new string from this string, replacing all characters that are not valid with underscore.
Definition at line 25 of file identifier.cc.
bool rcstring::is_lower_case | ( | void | ) | const |
The is_lower_case method is used to determine whether or not this string is contain no upper case characters (as decided by the isupper() standard C function).
Definition at line 25 of file is_lower_case.cc.
bool rcstring::is_printable | ( | void | ) | const |
The is_printable method is used to determine whether or not this string is entirely composed to printable characters (as decided by the isprint() standard C function).
Definition at line 24 of file is_printable.cc.
bool rcstring::operator!= | ( | const rcstring & | rhs | ) | const [inline] |
The inequality operator.
Definition at line 315 of file rcstring.h.
The add and replace operator.
Definition at line 366 of file rcstring.h.
The assignment operator.
Definition at line 76 of file rcstring.h.
bool rcstring::operator== | ( | const rcstring & | rhs | ) | const [inline] |
The equality operator.
Definition at line 305 of file rcstring.h.
char rcstring::operator[] | ( | int | idx | ) | const |
rcstring rcstring::quote_c | ( | void | ) | const |
The quote_c method is used to build a new string from this string using C quoting rules.
Definition at line 25 of file quote_c.cc.
rcstring rcstring::quote_shell | ( | void | ) | const |
The quote_shell method is used to build a new string from this string using shell quoting rules. If no quoting is required, none will be used.
Definition at line 26 of file quote_shell.cc.
rcstring rcstring::replace | ( | const rcstring & | from, |
const rcstring & | to, | ||
size_t | ntimes | ||
) | const |
The replace method is used to create a new string from this string, froplacing substring "from" with "to" for as many times as requested.
from | The string to look for, and replace instances of. The empty string will be ignored. |
to | what to replace it with |
ntimes | how many times to replace it. |
Definition at line 26 of file replace.cc.
size_t rcstring::size | ( | void | ) | const [inline] |
Definition at line 332 of file rcstring.h.
rcstring rcstring::spaces | ( | size_t | n | ) | [static] |
bool rcstring::starts_with | ( | const rcstring & | prefix | ) | const |
The starts_with method is used to determine whether or not this string ends with the given prefix.
Definition at line 25 of file starts_with.cc.
rcstring rcstring::substr | ( | size_t | start, |
size_t | len | ||
) | const |
Extract a substring.
Definition at line 416 of file rcstring.cc.
bool rcstring::to_long | ( | long & | n, |
int | base = 10 |
||
) | const |
The to_long method to used to conver the string into an integer. Returns true on success (and sets n) or false on failure.
Definition at line 428 of file rcstring.cc.
rcstring rcstring::trim | ( | void | ) | const |
rcstring rcstring::trim_right | ( | void | ) | const |
The trim_rigth method is used to create a new string from this string, but with white space removed from the (right hand) end.
Definition at line 25 of file trim_right.cc.
rcstring rcstring::upcase | ( | void | ) | const |
Turn the string into upper case.
Definition at line 289 of file rcstring.cc.
rcstring rcstring::vformat | ( | const char * | fmt, |
va_list | ap | ||
) | [static] |
Definition at line 350 of file rcstring.cc.
string_ty* rcstring::value [private] |
The value of the rcstring. (Should never be NULL.)
Definition at line 288 of file rcstring.h.