![]() |
Public API Reference |
![]() |
Subclass of csStringBase that contains an internal buffer which is faster than the always dynamically allocated buffer of csStringBase. More...
#include <csutil/csstring.h>
Public Member Functions | |
csStringFast () | |
Create an empty csStringFast object. | |
csStringFast (size_t Length) | |
Create a csStringFast object and reserve space for at least Length characters. | |
csStringFast (const csStringBase ©) | |
Copy constructor. | |
csStringFast (const csStringFast ©) | |
Copy constructor. | |
csStringFast (const char *src) | |
Create a csStringFast object from a null-terminated C string. | |
csStringFast (const char *src, size_t _length) | |
Create a csStringFast object from a C string, given the length. | |
csStringFast (const wchar_t *src) | |
Create a csString object from a null-terminated wide string. | |
csStringFast (const wchar_t *src, size_t _length) | |
Create a csStringBase object from a wide string, given the length. | |
csStringFast (char c) | |
Create a csStringFast object from a single signed character. | |
csStringFast (unsigned char c) | |
Create a csStringFast object from a single unsigned character. | |
virtual char * | Detach () |
Detach the low-level null-terminated C-string buffer from the csString object. | |
virtual void | Free () |
Free the memory allocated for the string. | |
virtual size_t | GetCapacity () const |
Return the current capacity, not including the space for the implicit null terminator. | |
virtual char const * | GetData () const |
Get a pointer to the null-terminated character array. | |
const csStringFast & | operator= (const csStringBase ©) |
Assign a value to this string. | |
template<typename T > | |
const csStringFast & | operator= (T const &s) |
Assign a formatted value to this string. | |
virtual void | ShrinkBestFit () |
Set string buffer capacity to hold exactly the current content. | |
virtual | ~csStringFast () |
Destroy the csStringFast. | |
Protected Member Functions | |
virtual char * | GetDataMutable () |
Get a pointer to the null-terminated character array. | |
virtual void | SetCapacityInternal (size_t NewSize, bool soft) |
Set the buffer to hold NewSize bytes. | |
Protected Attributes | |
char | minibuff [LEN] |
Internal buffer; used when capacity fits within LEN bytes. | |
size_t | miniused |
Amount of minibuff allocated by SetCapacityInternal(); not necessarily same as Size. |
Subclass of csStringBase that contains an internal buffer which is faster than the always dynamically allocated buffer of csStringBase.
Definition at line 958 of file csstring.h.
csStringFast< LEN >::csStringFast | ( | ) | [inline] |
Create an empty csStringFast object.
Definition at line 1008 of file csstring.h.
csStringFast< LEN >::csStringFast | ( | size_t | Length | ) | [inline] |
Create a csStringFast object and reserve space for at least Length characters.
Definition at line 1013 of file csstring.h.
csStringFast< LEN >::csStringFast | ( | const csStringBase & | copy | ) | [inline] |
Copy constructor.
Definition at line 1018 of file csstring.h.
csStringFast< LEN >::csStringFast | ( | const csStringFast< LEN > & | copy | ) | [inline] |
Copy constructor.
Definition at line 1023 of file csstring.h.
csStringFast< LEN >::csStringFast | ( | const char * | src | ) | [inline] |
Create a csStringFast object from a null-terminated C string.
Definition at line 1028 of file csstring.h.
csStringFast< LEN >::csStringFast | ( | const char * | src, |
size_t | _length | ||
) | [inline] |
Create a csStringFast object from a C string, given the length.
Definition at line 1033 of file csstring.h.
csStringFast< LEN >::csStringFast | ( | const wchar_t * | src | ) | [inline] |
Create a csString object from a null-terminated wide string.
Definition at line 1037 of file csstring.h.
csStringFast< LEN >::csStringFast | ( | const wchar_t * | src, |
size_t | _length | ||
) | [inline] |
Create a csStringBase object from a wide string, given the length.
Definition at line 1040 of file csstring.h.
csStringFast< LEN >::csStringFast | ( | char | c | ) | [inline] |
Create a csStringFast object from a single signed character.
Definition at line 1044 of file csstring.h.
csStringFast< LEN >::csStringFast | ( | unsigned char | c | ) | [inline] |
Create a csStringFast object from a single unsigned character.
Definition at line 1047 of file csstring.h.
virtual csStringFast< LEN >::~csStringFast | ( | ) | [inline, virtual] |
Destroy the csStringFast.
Definition at line 1050 of file csstring.h.
virtual char* csStringFast< LEN >::Detach | ( | ) | [inline, virtual] |
Detach the low-level null-terminated C-string buffer from the csString object.
Reimplemented from csStringBase.
Definition at line 1092 of file csstring.h.
virtual void csStringFast< LEN >::Free | ( | ) | [inline, virtual] |
Free the memory allocated for the string.
Reimplemented from csStringBase.
Definition at line 1090 of file csstring.h.
virtual size_t csStringFast< LEN >::GetCapacity | ( | ) | const [inline, virtual] |
Return the current capacity, not including the space for the implicit null terminator.
Reimplemented from csStringBase.
Definition at line 1063 of file csstring.h.
virtual char const* csStringFast< LEN >::GetData | ( | ) | const [inline, virtual] |
Get a pointer to the null-terminated character array.
Reimplemented from csStringBase.
Definition at line 1060 of file csstring.h.
virtual char* csStringFast< LEN >::GetDataMutable | ( | ) | [inline, protected, virtual] |
Get a pointer to the null-terminated character array.
Reimplemented from csStringBase.
Definition at line 1001 of file csstring.h.
const csStringFast& csStringFast< LEN >::operator= | ( | const csStringBase & | copy | ) | [inline] |
Assign a value to this string.
Reimplemented from csStringBase.
Reimplemented in csString.
Definition at line 1053 of file csstring.h.
const csStringFast& csStringFast< LEN >::operator= | ( | T const & | s | ) | [inline] |
Assign a formatted value to this string.
Reimplemented from csStringBase.
Definition at line 1058 of file csstring.h.
virtual void csStringFast< LEN >::SetCapacityInternal | ( | size_t | NewSize, |
bool | soft | ||
) | [inline, protected, virtual] |
Set the buffer to hold NewSize bytes.
If soft is true it means the buffer can be rounded up to reduce the number of allocations needed.
Reimplemented from csStringBase.
Definition at line 973 of file csstring.h.
virtual void csStringFast< LEN >::ShrinkBestFit | ( | ) | [inline, virtual] |
Set string buffer capacity to hold exactly the current content.
Reimplemented from csStringBase.
Definition at line 1066 of file csstring.h.
char csStringFast< LEN >::minibuff[LEN] [protected] |
Internal buffer; used when capacity fits within LEN bytes.
Definition at line 962 of file csstring.h.
size_t csStringFast< LEN >::miniused [protected] |
Amount of minibuff allocated by SetCapacityInternal(); not necessarily same as Size.
This is analogous to MaxSize in csStringBase. We need it to determine if minibuff was ever used in order to return NULL if not (to emulate the NULL returned by csStringBase when no buffer has been allocated). We also use minibuff to emulate GetCapacity(), which is a predicate of several memory management methods, such as ExpandIfNeeded().
Definition at line 971 of file csstring.h.