#include <FUStringBuilder.h>
Public Types | |
typedef std::basic_string< Char > | String |
The standard string object which correspond to the builder. | |
Public Member Functions | |
FUStringBuilderT (const String &sz) | |
Creates a new builder with the content of the given string. | |
FUStringBuilderT (const Char *sz) | |
Creates a new builder with the content of the given character array. | |
FUStringBuilderT (Char ch, size_t count) | |
Creates a new builder with the given character repeated multiple times over the array. | |
FUStringBuilderT (size_t reserved) | |
Creates a new builder with an empty buffer. | |
FUStringBuilderT () | |
Creates a new builder with an empty buffer. | |
~FUStringBuilderT () | |
Deletes the builder. | |
void | reserve (size_t length) |
Reserves a given number of character slots. | |
size_t | length () |
Retrieves the length of the content within the builder. | |
void | clear () |
Clears the content of the builder. | |
bool | empty () |
Retrieves whether the builder is empty. | |
void | append (Char c) |
Appends a character to the content of the builder. | |
void | append (const String &sz) |
Appends a string to the content of the builder. | |
void | append (const Char *sz) |
Appends a character array to the content of the builder. | |
void | append (const FUStringBuilderT &b) |
Appends the content of a builder to the content of this builder. | |
void | append (int32 i) |
Appends the integer value, after converting it to a string, to the content of the builder. | |
void | append (uint32 i) |
See above. | |
void | append (uint64 i) |
See above. | |
void | append (int i) |
See above. | |
void | append (unsigned int i) |
See above. | |
void | append (float f) |
Appends the floating-point value, after converting it to a string, to the content of the builder. | |
void | append (double f) |
See above. | |
template<typename TYPE> | |
FUStringBuilderT & | operator+= (const TYPE &val) |
Appends a value to the content of the builder. | |
void | appendLine (const Char *sz) |
Appends a character array to the content of the builder. | |
void | remove (int32 start) |
Removes a section of the content of the builder. | |
void | remove (int32 start, int32 end) |
Removes a section of the content of the builder. | |
void | pop_back () |
Removes the last character of the content of the builder. | |
template<typename TYPE> | |
void | set (const TYPE &val) |
Sets the content of the builder to a given value. | |
template<typename TYPE> | |
FUStringBuilderT & | operator= (const TYPE &val) |
See above. | |
String | ToString () |
Converts the content of the builder to a standard string. | |
operator String () | |
See above. | |
const Char * | ToCharPtr () |
Converts the content of the builder to a character array. | |
operator const Char * () | |
See above. | |
int32 | index (Char c) |
Retrieves the index of the first character within the content of the builder that is equivalent to the given character. | |
int32 | rindex (Char c) |
Retrieves the index of the last character within the content of the builder that is equivalent to the given character. |
The template has two arguments: the character definition and the sprintf() functor class for float to string conversions.
This class should be used for all the string operations, as it contains a dynamically-resized buffer that is not directly tied to its content's length.
|
Creates a new builder with the content of the given string.
|
|
Creates a new builder with the content of the given character array.
|
|
Creates a new builder with the given character repeated multiple times over the array.
|
|
Creates a new builder with an empty buffer.
|
|
Deletes the builder. Its buffer will be cleared. Any pointers to its data will be dangling. |
|
Appends the floating-point value, after converting it to a string, to the content of the builder. If the floating-point value is the special token that represents infinity, the string "INF" is appended. If it represents the negative infinity, the string "-INF" is appended. If it represents the impossibility, the string "NaN" is appended.
|
|
Appends the integer value, after converting it to a string, to the content of the builder.
|
|
Appends the content of a builder to the content of this builder.
|
|
Appends a character array to the content of the builder.
|
|
Appends a string to the content of the builder.
|
|
Appends a character to the content of the builder.
|
|
Appends a character array to the content of the builder. A newline character will be appended after the character array.
|
|
Clears the content of the builder. This does not re-allocate a new buffer. |
|
Retrieves whether the builder is empty. A builder is considered empty when it has no content, regardless of the size or allocation status of its buffer.
|
|
Retrieves the index of the first character within the content of the builder that is equivalent to the given character.
|
|
Retrieves the length of the content within the builder.
|
|
Appends a value to the content of the builder. This is a shortcut for the append function.
|
|
Removes a section of the content of the builder. The substring defined by the 'start' and 'end' indices will be removed. The 'start' character is removed and is replaced by the 'end' character.
|
|
Removes a section of the content of the builder. Every character that occurs after the given index will be removed, resulting in a shrunk string.
|
|
Reserves a given number of character slots. If the builder has a buffer with a different number of character slots, a new buffer will be allocated. If the builder has contents, it will be copied within the new buffer. If there is more content than the new buffer can handle, it will be discarded.
|
|
Retrieves the index of the last character within the content of the builder that is equivalent to the given character.
|
|
Sets the content of the builder to a given value. This clears the builder of all its content and appends the given value.
|
|
Converts the content of the builder to a character array.
|
|
Converts the content of the builder to a standard string.
|