|
cppcore
A small, portable C++ core library
|
This class is used to describe the inner data of a string. More...
#include <TStringBase.h>
Public Member Functions | |
| TStringBase () noexcept=default | |
| The default class constructor. | |
| TStringBase (const T *ptr, size_t size) | |
| The class constructor with a pointer showing to the data buffer. | |
| ~TStringBase () | |
| The class destructor. | |
| void | set (const T *ptr, size_t size) |
| Will set a new string. | |
| void | clear () |
| Will clear the string buffer. | |
| void | reset () |
| Will reset the string buffer, not internal storage will be released. | |
| size_t | size () const |
| Returns the size of the string buffer. | |
| bool | isEmpty () const |
| Will return true, if the string is empty. | |
| size_t | capacity () const |
| Will return the whole capacity of the string. | |
| const T * | c_str () const |
| Will return the string pointer. | |
| bool | operator== (const TStringBase< T > &rhs) const |
| Compare operator. | |
| bool | operator!= (const TStringBase< T > &rhs) const |
| Not equal operator. | |
| TStringBase< T > & | operator+= (const TStringBase< T > &rhs) |
| TStringBase< T > & | operator+= (char c) |
| T | operator[] (size_t index) const |
Static Public Member Functions | |
| static void | copyFrom (TStringBase< T > &base, const T *pPtr, size_t size) |
| Helper method to copy data into the string. | |
This class is used to describe the inner data of a string.
Definition at line 38 of file TStringBase.h.
|
defaultnoexcept |
The default class constructor.
Referenced by copyFrom(), operator!=(), operator+=(), operator+=(), and operator==().
|
inline |
The class constructor with a pointer showing to the data buffer.
| [in] | ptr | The data buffer. |
| [in] | size | The buffer size. |
Definition at line 103 of file TStringBase.h.
References c_str(), copyFrom(), size(), and cppcore::THash< T >::toHash().
|
inline |
|
inline |
Will return the string pointer.
Definition at line 143 of file TStringBase.h.
Referenced by operator+=(), operator==(), and TStringBase().
|
inline |
Will return the whole capacity of the string.
Definition at line 138 of file TStringBase.h.
|
inline |
Will clear the string buffer.
Definition at line 152 of file TStringBase.h.
References reset().
Referenced by ~TStringBase().
|
inlinestatic |
Helper method to copy data into the string.
| base | [inout] The string data to copy in. |
| pPtr | [in] The data source. |
Definition at line 162 of file TStringBase.h.
References size(), and TStringBase().
Referenced by operator+=(), operator+=(), set(), and TStringBase().
|
inline |
Will return true, if the string is empty.
Definition at line 133 of file TStringBase.h.
Referenced by operator+=(), and cppcore::Logger::print().
|
inline |
|
inline |
Definition at line 216 of file TStringBase.h.
References copyFrom(), and TStringBase().
|
inline |
Definition at line 205 of file TStringBase.h.
References c_str(), copyFrom(), isEmpty(), size(), and TStringBase().
|
inline |
Compare operator.
Definition at line 186 of file TStringBase.h.
References c_str(), and TStringBase().
|
inline |
Definition at line 222 of file TStringBase.h.
|
inline |
Will reset the string buffer, not internal storage will be released.
Definition at line 122 of file TStringBase.h.
|
inline |
Will set a new string.
| ptr | Pointer to the buffer. |
| size | Size of the buffer. |
Definition at line 114 of file TStringBase.h.
References copyFrom(), reset(), and size().
|
inline |
Returns the size of the string buffer.
Definition at line 128 of file TStringBase.h.
Referenced by copyFrom(), operator+=(), cppcore::Logger::print(), set(), and TStringBase().