Vault  4.1
Classes | Defines | Typedefs | Functions
vstring.h File Reference
#include "vtypes.h"
#include "vcodepoint.h"
#include "vstringiterator.h"

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< VStringVStringVector
 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.
VStringoperator<< (VString &s, std::istream &in)
 Appends to the string by reading an istream.
VStringoperator<< (VString &s, const char *in)
 Appends to the string by copying a C string.
VStringoperator<< (VString &s, int i)
 Appends to the string by copying an int as string.
VStringoperator<< (VString &s, Vu8 i)
 Appends to the string by copying a Vu8 as string.
VStringoperator<< (VString &s, Vs8 i)
 Appends to the string by copying a Vs8 as string.
VStringoperator<< (VString &s, Vu16 i)
 Appends to the string by copying a Vu16 as string.
VStringoperator<< (VString &s, Vs16 i)
 Appends to the string by copying a Vs16 as string.
VStringoperator<< (VString &s, Vu32 i)
 Appends to the string by copying a Vu32 as string.
VStringoperator<< (VString &s, Vu64 i)
 Appends to the string by copying a Vu64 as string.
VStringoperator<< (VString &s, Vs64 i)
 Appends to the string by copying a Vs64 as string.
VStringoperator<< (VString &s, VDouble f)
 Appends to the string by copying a VDouble as string.

Detailed Description

Definition in file vstring.h.


Typedef Documentation

typedef std::vector<VString> VStringVector

VStringVector is simply a vector of VString objects.

Note that the vector elements are objects, not pointers to objects.

Definition at line 18 of file vstring.h.


Function Documentation

bool operator== ( const VString lhs,
const VString rhs 
) [inline]

Compares lhs and rhs for equality.

Parameters:
lhsa string
rhsa string
Returns:
true if lhs and rhs are equal according to strcmp()

Definition at line 1408 of file vstring.h.

bool operator== ( const VString lhs,
const char *  rhs 
) [inline]

Compares lhs and rhs for equality.

Parameters:
lhsa string
rhsa C string
Returns:
true if lhs and rhs are equal according to strcmp()

Definition at line 1409 of file vstring.h.

bool operator== ( const char *  lhs,
const VString rhs 
) [inline]

Compares lhs and rhs for equality.

Parameters:
lhsa C string
rhsa string
Returns:
true if lhs and rhs are equal according to strcmp()

Definition at line 1410 of file vstring.h.

bool operator== ( const VString lhs,
char  rhs 
) [inline]

Compares s and c for equality.

Parameters:
lhsa string
rhsa char
Returns:
true if lhs is one character in length, the character being rhs

Definition at line 1411 of file vstring.h.

References VString::charAt(), and VString::length().

bool operator!= ( const VString lhs,
const VString rhs 
) [inline]

Compares lhs and rhs for inequality.

Parameters:
lhsa string
rhsa string
Returns:
true if lhs and rhs are not equal according to strcmp()

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.

Parameters:
lhsa string
rhsa C string
Returns:
true if lhs and rhs are not equal according to strcmp()

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.

Parameters:
lhsa C string
rhsa string
Returns:
true if lhs and rhs are not equal according to strcmp()

Definition at line 1415 of file vstring.h.

References operator==().

bool operator!= ( const VString lhs,
char  rhs 
) [inline]

Compares lhs and rhs for inequality.

Parameters:
lhsa string
rhsa char
Returns:
true if lhs is NOT one character in length, or if its sole character is not rhs

Definition at line 1416 of file vstring.h.

References operator==().

bool operator< ( const VString lhs,
const VString rhs 
) [inline]

Compares lhs and rhs.

Parameters:
lhsa string
rhsa string
Returns:
true if lhs < rhs according to strcmp()

Definition at line 1418 of file vstring.h.

bool operator< ( const VString lhs,
const char *  rhs 
) [inline]

Compares lhs and rhs.

Parameters:
lhsa string
rhsa C string
Returns:
true if lhs < rhs according to strcmp()

Definition at line 1419 of file vstring.h.

bool operator< ( const char *  lhs,
const VString rhs 
) [inline]

Compares lhs and rhs.

Parameters:
lhsa C string
rhsa string
Returns:
true if lhs < rhs according to strcmp()

Definition at line 1420 of file vstring.h.

bool operator<= ( const VString lhs,
const VString rhs 
) [inline]

Compares lhs and rhs.

Parameters:
lhsa string
rhsa string
Returns:
true if lhs <= rhs according to strcmp()

Definition at line 1422 of file vstring.h.

bool operator<= ( const VString lhs,
const char *  rhs 
) [inline]

Compares lhs and rhs.

Parameters:
lhsa string
rhsa C string
Returns:
true if lhs <= rhs according to strcmp()

Definition at line 1423 of file vstring.h.

bool operator<= ( const char *  lhs,
const VString rhs 
) [inline]

Compares lhs and rhs.

Parameters:
lhsa C string
rhsa string
Returns:
true if lhs <= rhs according to strcmp()

Definition at line 1424 of file vstring.h.

bool operator>= ( const VString lhs,
const VString rhs 
) [inline]

Compares lhs and rhs.

Parameters:
lhsa string
rhsa string
Returns:
true if lhs >= rhs according to strcmp()

Definition at line 1426 of file vstring.h.

References operator<().

bool operator>= ( const VString lhs,
const char *  rhs 
) [inline]

Compares lhs and rhs.

Parameters:
lhsa string
rhsa C string
Returns:
true if lhs >= rhs according to strcmp()

Definition at line 1427 of file vstring.h.

References operator<().

bool operator>= ( const char *  lhs,
const VString rhs 
) [inline]

Compares lhs and rhs.

Parameters:
lhsa C string
rhsa string
Returns:
true if lhs >= rhs according to strcmp()

Definition at line 1428 of file vstring.h.

References operator<().

bool operator> ( const VString lhs,
const VString rhs 
) [inline]

Compares lhs and rhs.

Parameters:
lhsa string
rhsa string
Returns:
true if lhs > rhs according to strcmp()

Definition at line 1430 of file vstring.h.

References operator<().

bool operator> ( const VString lhs,
const char *  rhs 
) [inline]

Compares lhs and rhs.

Parameters:
lhsa string
rhsa C string
Returns:
true if lhs > rhs according to strcmp()

Definition at line 1431 of file vstring.h.

References operator<().

bool operator> ( const char *  lhs,
const VString rhs 
) [inline]

Compares lhs and rhs.

Parameters:
lhsa C string
rhsa string
Returns:
true if lhs > rhs according to strcmp()

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.

Parameters:
inthe input stream
sthe string
Returns:
the input stream

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.

Parameters:
outthe output stream
sthe string
Returns:
the output stream

Definition at line 1435 of file vstring.h.

References VString::chars().

VString& operator<< ( VString s,
std::istream &  in 
) [inline]

Appends to the string by reading an istream.

Parameters:
sthe string
inthe input stream
Returns:
the string

Definition at line 1436 of file vstring.h.

References VString::appendFromIStream().

VString& operator<< ( VString s,
const char *  in 
) [inline]

Appends to the string by copying a C string.

Parameters:
sthe string
inthe input C string buffer
Returns:
the string

Definition at line 1438 of file vstring.h.

VString& operator<< ( VString s,
int  i 
) [inline]

Appends to the string by copying an int as string.

Parameters:
sthe string
ithe int to append
Returns:
the string

Definition at line 1439 of file vstring.h.

VString& operator<< ( VString s,
Vu8  i 
) [inline]

Appends to the string by copying a Vu8 as string.

Parameters:
sthe string
ithe Vu8 to append
Returns:
the string

Definition at line 1440 of file vstring.h.

VString& operator<< ( VString s,
Vs8  i 
) [inline]

Appends to the string by copying a Vs8 as string.

Parameters:
sthe string
ithe Vs8 to append
Returns:
the string

Definition at line 1441 of file vstring.h.

VString& operator<< ( VString s,
Vu16  i 
) [inline]

Appends to the string by copying a Vu16 as string.

Parameters:
sthe string
ithe Vu16 to append
Returns:
the string

Definition at line 1442 of file vstring.h.

VString& operator<< ( VString s,
Vs16  i 
) [inline]

Appends to the string by copying a Vs16 as string.

Parameters:
sthe string
ithe Vs16 to append
Returns:
the string

Definition at line 1443 of file vstring.h.

VString& operator<< ( VString s,
Vu32  i 
) [inline]

Appends to the string by copying a Vu32 as string.

Parameters:
sthe string
ithe Vu32 to append
Returns:
the string

Definition at line 1444 of file vstring.h.

VString& operator<< ( VString s,
Vu64  i 
) [inline]

Appends to the string by copying a Vu64 as string.

Parameters:
sthe string
ithe Vu64 to append
Returns:
the string

Definition at line 1450 of file vstring.h.

VString& operator<< ( VString s,
Vs64  i 
) [inline]

Appends to the string by copying a Vs64 as string.

Parameters:
sthe string
ithe Vs64 to append
Returns:
the string

Definition at line 1453 of file vstring.h.

VString& operator<< ( VString s,
VDouble  f 
) [inline]

Appends to the string by copying a VDouble as string.

Parameters:
sthe string
fthe VDouble to append
Returns:
the string

Definition at line 1456 of file vstring.h.


Copyright ©1997-2014 Trygve Isaacson. All rights reserved. This documentation was generated with Doxygen.