MySQL 5.6.14 Source Code Document
|
Null terminated strings. More...
#include <BaseString.hpp>
Public Member Functions | |
BaseString () | |
Constructs an empty string. | |
BaseString (const char *s) | |
Constructs a copy of a char *. | |
BaseString (const char *s, size_t len) | |
Constructs a copy of a char * with length. | |
BaseString (const BaseString &str) | |
Constructs a copy of another BaseString. | |
~BaseString () | |
Destructor. | |
const char * | c_str () const |
Returns a C-style string. | |
unsigned | length () const |
Returns the length of the string. | |
bool | empty () const |
Checks if the string is empty. | |
void | clear () |
Clear a string. | |
BaseString & | ndb_toupper () |
Convert to uppercase. | |
BaseString & | ndb_tolower () |
Convert to lowercase. | |
BaseString & | assign (const char *s) |
Assigns from a char *. | |
BaseString & | assign (const BaseString &str) |
Assigns from another BaseString. | |
BaseString & | assign (const char *s, size_t n) |
Assigns from char *s, with maximum length n. | |
BaseString & | assign (const BaseString &str, size_t n) |
Assigns from another BaseString, with maximum length n. | |
BaseString & | assign (const Vector< BaseString > &vector, const BaseString &separator=BaseString(" ")) |
BaseString & | append (const char *s) |
Appends a char * to the end. | |
BaseString & | append (char c) |
Appends a char to the end. | |
BaseString & | append (const BaseString &str) |
Appends another BaseString to the end. | |
BaseString & | append (const Vector< BaseString > &vector, const BaseString &separator=BaseString(" ")) |
BaseString & | assfmt (const char *ftm,...) ATTRIBUTE_FORMAT(printf |
Assigns from a format string a la printf() | |
BaseString BaseString & | appfmt (const char *ftm,...) ATTRIBUTE_FORMAT(printf |
Appends a format string a la printf() to the end. | |
BaseString BaseString int | split (Vector< BaseString > &vector, const BaseString &separator=BaseString(" "), int maxSize=-1) const |
ssize_t | indexOf (char c) const |
ssize_t | lastIndexOf (char c) const |
BaseString | substr (ssize_t start, ssize_t stop=-1) const |
BaseString & | operator= (const BaseString &str) |
Assignment operator. | |
bool | operator< (const BaseString &str) const |
Compare two strings. | |
bool | operator== (const BaseString &str) const |
Are two strings equal? | |
bool | operator== (const char *str) const |
Are two strings equal? | |
bool | operator!= (const BaseString &str) const |
Are two strings not equal? | |
bool | operator!= (const char *str) const |
Are two strings not equal? | |
BaseString & | trim (const char *delim=" \t") |
Static Public Member Functions | |
static char ** | argify (const char *argv0, const char *src) |
static char * | trim (char *src, const char *delim) |
static int | snprintf (char *str, size_t size, const char *format,...) ATTRIBUTE_FORMAT(printf |
static int static int | vsnprintf (char *str, size_t size, const char *format, va_list ap) |
template<unsigned size> | |
static BaseString | getText (const Bitmask< size > &mask) |
template<unsigned size> | |
static BaseString | getPrettyText (const Bitmask< size > &mask) |
template<unsigned size> | |
static BaseString | getPrettyTextShort (const Bitmask< size > &mask) |
template<unsigned size> | |
static BaseString | getText (const BitmaskPOD< size > &mask) |
template<unsigned size> | |
static BaseString | getPrettyText (const BitmaskPOD< size > &mask) |
template<unsigned size> | |
static BaseString | getPrettyTextShort (const BitmaskPOD< size > &mask) |
static BaseString | getText (unsigned size, const Uint32 data[]) |
static BaseString | getPrettyText (unsigned size, const Uint32 data[]) |
static BaseString | getPrettyTextShort (unsigned size, const Uint32 data[]) |
Friends | |
bool | operator! (const BaseString &str) |
Null terminated strings.
Definition at line 29 of file BaseString.hpp.
BaseString & BaseString::append | ( | const Vector< BaseString > & | vector, |
const BaseString & | separator = BaseString(" ") |
||
) |
Appends a Vector of BaseStrings to the end, each Vector entry separated by separator.
vector | Vector of BaseStrings to append |
separator | Separation between appended strings |
Definition at line 197 of file BaseString.cpp.
|
static |
Return c-array with strings suitable for execve When whitespace is detected, the characters '"' and '\' are honored, to make it possible to give arguments containing whitespace. The semantics of '"' and '\' match that of most Unix shells.
Definition at line 342 of file BaseString.cpp.
|
inline |
Assings from a Vector of BaseStrings, each Vector entry separated by separator.
vector | Vector of BaseStrings to append |
separator | Separation between appended strings |
Definition at line 320 of file BaseString.hpp.
ssize_t BaseString::indexOf | ( | char | c | ) | const |
Returns the index of the first occurance of the character c.
c character to look for
Definition at line 300 of file BaseString.cpp.
ssize_t BaseString::lastIndexOf | ( | char | c | ) | const |
Returns the index of the last occurance of the character c.
c character to look for
Definition at line 309 of file BaseString.cpp.
|
static |
snprintf on some platforms need special treatment
Definition at line 495 of file BaseString.cpp.
int BaseString::split | ( | Vector< BaseString > & | vector, |
const BaseString & | separator = BaseString(" ") , |
||
int | maxSize = -1 |
||
) | const |
Split a string into a vector of strings. Separate the string where any character included in separator exists. Maximally maxSize entries are added to the vector, if more separators exist in the string, the remainder of the string will be appended to the last entry in the vector. The vector will not be cleared, so any existing strings in the vector will remain.
separator | characters separating the entries |
vector | where the separated strings will be stored |
maximum | number of strings extracted |
Definition at line 277 of file BaseString.cpp.
BaseString BaseString::substr | ( | ssize_t | start, |
ssize_t | stop = -1 |
||
) | const |
Returns a subset of a string
start | index of first character |
stop | index of last character |
Definition at line 318 of file BaseString.cpp.
BaseString & BaseString::trim | ( | const char * | delim = " \t" | ) |
Trim string from delim
Definition at line 461 of file BaseString.cpp.
|
static |
Trim string from delim
Definition at line 468 of file BaseString.cpp.