- StringAdd
- StringBufferLen
- StringCompare
- StringConcatenate
- StringFill
- StringFind
- StringGetCharacter
- StringInit
- StringLen
- StringSetLength
- StringReplace
- StringReserve
- StringSetCharacter
- StringSplit
- StringSubstr
- StringToLower
- StringToUpper
- StringTrimLeft
- StringTrimRight
StringReserve
Reserves the buffer of a specified size for a string in memory.
bool StringReserve(
|
Parameters
string_var
[in][out] String the buffer size should change the size for.
new_capacity
[in] Buffer size required for a string. If the new_capacity size is less than the string length, the size of the current buffer does not change.
Return Value
In case of successful execution, returns true, otherwise - false. To receive an error code, the GetLastError() function should be called.
Note
Generally, the string size is not equal to the size of the buffer meant for storing the string. When creating a string, the appropriate buffer is usually allocated with a margin. The StringReserve() function allows managing the buffer size and specify the optimal size for future operations.
Unlike StringInit(), the StringReserve() function does not change the string contents and does not fill it with characters.
Example:
void OnStart()
|
See also
StringBufferLen, StringSetLength, StringInit, StringSetCharacter