Logo Search packages:      
Sourcecode: virtualbox-ose version File versions  Download package

iprt::MiniString Class Reference

#include <ministring.h>

Inheritance diagram for iprt::MiniString:

com::Utf8Str com::Utf8StrFmt com::Utf8StrFmtVA

List of all members.

Detailed Description

Mini C++ string class.

"MiniString" is a small C++ string class that does not depend on anything else except IPRT memory management functions. Semantics are like in std::string, except it can do a lot less.

Note that MiniString does not differentiate between NULL strings and empty strings. In other words, MiniString("") and MiniString(NULL) behave the same. In both cases, MiniString allocates no memory, reports a zero length and zero allocated bytes for both, and returns an empty C string from c_str().

Definition at line 60 of file ministring.h.

Public Types

enum  CaseSensitivity { CaseSensitive, CaseInsensitive }

Public Member Functions

MiniStringappend (char c)
MiniStringappend (const MiniString &that)
const char * c_str () const
size_t capacity () const
int compare (const MiniString &that, CaseSensitivity cs=CaseSensitive) const
int compare (const char *pcsz, CaseSensitivity cs=CaseSensitive) const
bool contains (const iprt::MiniString &that, CaseSensitivity cs=CaseSensitive) const
bool endsWith (const iprt::MiniString &that, CaseSensitivity cs=CaseSensitive) const
size_t find (const char *pcszFind, size_t pos=0) const
bool isEmpty () const
void jolt ()
size_t length () const
 MiniString (const char *pcsz)
 MiniString (const MiniString &s)
 MiniString ()
char * mutableRaw ()
MiniStringoperator= (const MiniString &s)
MiniStringoperator= (const char *pcsz)
char operator[] (size_t i) const
const char * raw () const
void reserve (size_t cb)
void setNull ()
bool startsWith (const iprt::MiniString &that, CaseSensitivity cs=CaseSensitive) const
iprt::MiniString substr (size_t pos=0, size_t n=npos) const
int toInt (uint32_t &i) const
int toInt (uint64_t &i) const
int64_t toInt64 () const
uint64_t toUInt64 () const
virtual ~MiniString ()
Comparison operators.
bool operator!= (const char *that) const
bool operator!= (const MiniString &that) const
bool operator< (const char *that) const
bool operator< (const MiniString &that) const
bool operator== (const char *that) const
bool operator== (const MiniString &that) const
bool operator> (const char *that) const
bool operator> (const MiniString &that) const

Static Public Attributes

static const size_t npos = ~(size_t)0

Protected Member Functions

void cleanup ()
void copyFrom (const char *pcsz)
void copyFrom (const MiniString &s)
 operator bool () const

Protected Attributes

size_t m_cbAllocated
size_t m_cbLength
char * m_psz

The documentation for this class was generated from the following files:

Generated by  Doxygen 1.6.0   Back to index