Provides efficient way of accessing text-based field values, left justified and right padded. More...
Public Types | |
typedef const char * | ConstIterator |
Immutable iterator over chars. | |
Public Member Functions | |
StringRef () | |
Initializes blank instance. | |
StringRef (const char *chars, size_t size) | |
Full initialization. | |
StringRef (const StringRef &other) | |
Initializes as clone of other instance. | |
StringRef (const std::string &stdStr) | |
Initializes instance from string content. | |
StringRef (const char *cStr) | |
Initializes instance from zero-terminated string. | |
bool | empty () const |
Indicates whether array of zero length. | |
const char * | data () const |
Read-only content. | |
ConstIterator | begin () const |
STL-like begin(). | |
ConstIterator | end () const |
STL-like end(). | |
size_t | size () const |
Number of chars. | |
void | reset () |
Resets reference to nothing. | |
void | reset (const char *chars, size_t size) |
Updates data being referenced. | |
const char & | operator[] (size_t index) const |
const char & | at (size_t index) const |
void | toString (std::string &str) const |
std::string | toString () const |
bool | operator== (const StringRef &other) const |
Compares with another instance. | |
bool | operator!= (const StringRef &other) const |
Compares with another instance. | |
StringRef & | operator= (const StringRef &other) |
Reinitializes from another instance. | |
void | swap (StringRef &other) |
Swaps content with other instance. |
Provides efficient way of accessing text-based field values, left justified and right padded.