Vault
4.1
|
Go to the source code of this file.
Classes | |
class | VString |
VString is a string container class that should help to eliminate almost all use of char buffer and char* and their inherent dangers, in the Vault APIs and most source code. More... | |
Defines | |
#define | VSTRING_FORMAT(format_string,...) VString(format_string, __VA_ARGS__) |
#define | VSTRING_ARGS(format_string,...) format_string, __VA_ARGS__ |
#define | VSTRING_COPY(literal_string) VString((char*)literal_string) |
#define | VSTRING_FORMATTER_INT "%d" |
#define | VSTRING_FORMATTER_UINT "%u" |
#define | VSTRING_FORMATTER_LONG "%ld" |
#define | VSTRING_FORMATTER_ULONG "%lu" |
#define | VSTRING_FORMATTER_SIZE "%zu" |
#define | VSTRING_FORMATTER_S8 "%hhd" |
#define | VSTRING_FORMATTER_U8 "%hhu" |
#define | VSTRING_FORMATTER_S16 "%hd" |
#define | VSTRING_FORMATTER_U16 "%hu" |
#define | VSTRING_FORMATTER_S32 VSTRING_FORMATTER_INT |
#define | VSTRING_FORMATTER_U32 VSTRING_FORMATTER_UINT |
#define | VSTRING_FORMATTER_S64 "%lld" |
#define | VSTRING_FORMATTER_U64 "%llu" |
#define | VSTRING_FORMATTER_FLOAT "%f" |
#define | VSTRING_FORMATTER_DOUBLE "%lf" |
#define | VSTRING_FORMATTER_PTR "%p" |
#define | VSTRING_INT(n) VSTRING_FORMAT(VSTRING_FORMATTER_INT, n) |
Creates a string by formatting an int value. | |
#define | VSTRING_UINT(n) VSTRING_FORMAT(VSTRING_FORMATTER_UINT, n) |
Creates a string by formatting an unsigned int value. | |
#define | VSTRING_LONG(n) VSTRING_FORMAT(VSTRING_FORMATTER_LONG, n) |
Creates a string by formatting a long value. | |
#define | VSTRING_ULONG(n) VSTRING_FORMAT(VSTRING_FORMATTER_ULONG, n) |
Creates a string by formatting an unsigned long value. | |
#define | VSTRING_SIZE(z) VSTRING_FORMAT(VSTRING_FORMATTER_SIZE, z) |
Creates a string by formatting a size_t value. | |
#define | VSTRING_S8(n) VSTRING_FORMAT(VSTRING_FORMATTER_S8, n) |
Creates a string by formatting an 8-bit int value. | |
#define | VSTRING_U8(n) VSTRING_FORMAT(VSTRING_FORMATTER_U8, n) |
Creates a string by formatting an unsigned 8-bit int value. | |
#define | VSTRING_S16(n) VSTRING_FORMAT(VSTRING_FORMATTER_S16, n) |
Creates a string by formatting a 16-bit int value. | |
#define | VSTRING_U16(n) VSTRING_FORMAT(VSTRING_FORMATTER_U16, n) |
Creates a string by formatting an unsigned 16-bit int value. | |
#define | VSTRING_S32(n) VSTRING_FORMAT(VSTRING_FORMATTER_S32, n) |
Creates a string by formatting a 32-bit int value. | |
#define | VSTRING_U32(n) VSTRING_FORMAT(VSTRING_FORMATTER_U32, n) |
Creates a string by formatting an unsigned 32-bit int value. | |
#define | VSTRING_S64(n) VSTRING_FORMAT(VSTRING_FORMATTER_S64, n) |
Creates a string by formatting a 64-bit int value. | |
#define | VSTRING_U64(n) VSTRING_FORMAT(VSTRING_FORMATTER_U64, n) |
Creates a string by formatting an unsigned 64-bit int value. | |
#define | VSTRING_FLOAT(n) VSTRING_FORMAT(VSTRING_FORMATTER_FLOAT, n) |
Creates a string by formatting a float value. | |
#define | VSTRING_DOUBLE(n) VSTRING_FORMAT(VSTRING_FORMATTER_DOUBLE, n) |
Creates a string by formatting a double value. | |
#define | VSTRING_PTR(p) VSTRING_FORMAT(VSTRING_FORMATTER_PTR, p) |
Creates a string by formatting a pointer as hexadecimal preceded by 0x. | |
#define | VSTRING_BOOL(b) VString(b ? "true" : "false") |
Creates a string from a boolean as the text "true" or "false". | |
#define | VSTRING_INTERNAL_BUFFER_SIZE 7 |
Typedefs | |
typedef std::vector< VString > | VStringVector |
VStringVector is simply a vector of VString objects. | |
typedef std::vector< VString * > | VStringPtrVector |
VStringPtrVector is a vector of pointers to VString objects. | |
Functions | |
bool | operator== (const VString &lhs, const VString &rhs) |
Compares lhs and rhs for equality. | |
bool | operator== (const VString &lhs, const char *rhs) |
Compares lhs and rhs for equality. | |
bool | operator== (const char *lhs, const VString &rhs) |
Compares lhs and rhs for equality. | |
bool | operator== (const VString &lhs, char rhs) |
Compares s and c for equality. | |
bool | operator!= (const VString &lhs, const VString &rhs) |
Compares lhs and rhs for inequality. | |
bool | operator!= (const VString &lhs, const char *rhs) |
Compares lhs and rhs for inequality. | |
bool | operator!= (const char *lhs, const VString &rhs) |
Compares lhs and rhs for inequality. | |
bool | operator!= (const VString &lhs, char rhs) |
Compares lhs and rhs for inequality. | |
bool | operator< (const VString &lhs, const VString &rhs) |
Compares lhs and rhs. | |
bool | operator< (const VString &lhs, const char *rhs) |
Compares lhs and rhs. | |
bool | operator< (const char *lhs, const VString &rhs) |
Compares lhs and rhs. | |
bool | operator<= (const VString &lhs, const VString &rhs) |
Compares lhs and rhs. | |
bool | operator<= (const VString &lhs, const char *rhs) |
Compares lhs and rhs. | |
bool | operator<= (const char *lhs, const VString &rhs) |
Compares lhs and rhs. | |
bool | operator>= (const VString &lhs, const VString &rhs) |
Compares lhs and rhs. | |
bool | operator>= (const VString &lhs, const char *rhs) |
Compares lhs and rhs. | |
bool | operator>= (const char *lhs, const VString &rhs) |
Compares lhs and rhs. | |
bool | operator> (const VString &lhs, const VString &rhs) |
Compares lhs and rhs. | |
bool | operator> (const VString &lhs, const char *rhs) |
Compares lhs and rhs. | |
bool | operator> (const char *lhs, const VString &rhs) |
Compares lhs and rhs. | |
std::istream & | operator>> (std::istream &in, VString &s) |
Creates the string by reading an istream. | |
std::ostream & | operator<< (std::ostream &out, const VString &s) |
Writes the string to an ostream. | |
VString & | operator<< (VString &s, std::istream &in) |
Appends to the string by reading an istream. | |
VString & | operator<< (VString &s, const char *in) |
Appends to the string by copying a C string. | |
VString & | operator<< (VString &s, int i) |
Appends to the string by copying an int as string. | |
VString & | operator<< (VString &s, Vu8 i) |
Appends to the string by copying a Vu8 as string. | |
VString & | operator<< (VString &s, Vs8 i) |
Appends to the string by copying a Vs8 as string. | |
VString & | operator<< (VString &s, Vu16 i) |
Appends to the string by copying a Vu16 as string. | |
VString & | operator<< (VString &s, Vs16 i) |
Appends to the string by copying a Vs16 as string. | |
VString & | operator<< (VString &s, Vu32 i) |
Appends to the string by copying a Vu32 as string. | |
VString & | operator<< (VString &s, Vu64 i) |
Appends to the string by copying a Vu64 as string. | |
VString & | operator<< (VString &s, Vs64 i) |
Appends to the string by copying a Vs64 as string. | |
VString & | operator<< (VString &s, VDouble f) |
Appends to the string by copying a VDouble as string. |
Definition in file vstring.h.
typedef std::vector<VString> VStringVector |
bool operator== | ( | const VString & | lhs, |
const char * | rhs | ||
) | [inline] |
bool operator== | ( | const char * | lhs, |
const VString & | rhs | ||
) | [inline] |
bool operator== | ( | const VString & | lhs, |
char | rhs | ||
) | [inline] |
Compares s and c for equality.
lhs | a string |
rhs | a char |
Definition at line 1411 of file vstring.h.
References VString::charAt(), and VString::length().
Compares lhs and rhs for inequality.
lhs | a string |
rhs | a string |
Definition at line 1413 of file vstring.h.
References operator==().
bool operator!= | ( | const VString & | lhs, |
const char * | rhs | ||
) | [inline] |
Compares lhs and rhs for inequality.
lhs | a string |
rhs | a C string |
Definition at line 1414 of file vstring.h.
References operator==().
bool operator!= | ( | const char * | lhs, |
const VString & | rhs | ||
) | [inline] |
Compares lhs and rhs for inequality.
lhs | a C string |
rhs | a string |
Definition at line 1415 of file vstring.h.
References operator==().
bool operator!= | ( | const VString & | lhs, |
char | rhs | ||
) | [inline] |
Compares lhs and rhs for inequality.
lhs | a string |
rhs | a char |
Definition at line 1416 of file vstring.h.
References operator==().
bool operator< | ( | const VString & | lhs, |
const char * | rhs | ||
) | [inline] |
bool operator< | ( | const char * | lhs, |
const VString & | rhs | ||
) | [inline] |
bool operator<= | ( | const VString & | lhs, |
const char * | rhs | ||
) | [inline] |
bool operator<= | ( | const char * | lhs, |
const VString & | rhs | ||
) | [inline] |
Compares lhs and rhs.
lhs | a string |
rhs | a string |
Definition at line 1426 of file vstring.h.
References operator<().
bool operator>= | ( | const VString & | lhs, |
const char * | rhs | ||
) | [inline] |
Compares lhs and rhs.
lhs | a string |
rhs | a C string |
Definition at line 1427 of file vstring.h.
References operator<().
bool operator>= | ( | const char * | lhs, |
const VString & | rhs | ||
) | [inline] |
Compares lhs and rhs.
lhs | a C string |
rhs | a string |
Definition at line 1428 of file vstring.h.
References operator<().
Compares lhs and rhs.
lhs | a string |
rhs | a string |
Definition at line 1430 of file vstring.h.
References operator<().
bool operator> | ( | const VString & | lhs, |
const char * | rhs | ||
) | [inline] |
Compares lhs and rhs.
lhs | a string |
rhs | a C string |
Definition at line 1431 of file vstring.h.
References operator<().
bool operator> | ( | const char * | lhs, |
const VString & | rhs | ||
) | [inline] |
Compares lhs and rhs.
lhs | a C string |
rhs | a string |
Definition at line 1432 of file vstring.h.
References operator<().
std::istream& operator>> | ( | std::istream & | in, |
VString & | s | ||
) | [inline] |
Creates the string by reading an istream.
in | the input stream |
s | the string |
Definition at line 1434 of file vstring.h.
References VString::readFromIStream().
std::ostream& operator<< | ( | std::ostream & | out, |
const VString & | s | ||
) | [inline] |
Writes the string to an ostream.
out | the output stream |
s | the string |
Definition at line 1435 of file vstring.h.
References VString::chars().
Appends to the string by reading an istream.
s | the string |
in | the input stream |
Definition at line 1436 of file vstring.h.
References VString::appendFromIStream().