template<typename T>
StringBuilderBase class
Derived classes
-
template<s32 N>class FixedStringBuilder
Public types
- class iterator
Public static functions
- static auto create(s32 buffer_size, Heap* heap, s32 alignment) -> StringBuilderBase*
- static auto create(const T* str, Heap* heap, s32 alignment) -> StringBuilderBase*
Constructors, destructors, conversion operators
- StringBuilderBase(const StringBuilderBase<T>& other) deleted
- operator SafeStringBase<T>() const
- StringBuilderBase(T* buffer, s32 buffer_size) protected
Public functions
- auto begin() const -> iterator
- auto end() const -> iterator
- auto getLength() const -> s32
- auto calcLength() const -> s32
- auto getBufferSize() const -> s32
- auto cstr() const -> const T*
- auto at(s32 idx) const -> const T&
- auto operator[](s32 idx) const -> const T&
- auto getPart(s32 at) const -> SafeStringBase<T>
- auto getPart(const iterator& it) const -> SafeStringBase<T>
- auto include(T c) const -> bool
- auto include(const T* str) const -> bool
- auto findIndex(const T* str) const -> s32
- auto findIndex(const T* str, s32 start_pos) const -> s32
- auto rfindIndex(const T* str) const -> s32
- auto isEmpty() const -> bool
- auto startsWith(const T* prefix) const -> bool
- auto endsWith(const T* suffix) const -> bool
- auto isEqual(const T* str) const -> bool
- auto comparen(const T* str, s32 n) const -> s32
- void clear()
- auto copy(const T* src, s32 copy_length = -1) -> s32
- auto copyAt(s32 at, const T* src, s32 copy_length = -1) -> s32
- auto cutOffCopy(const T* src, s32 copy_length = -1) -> s32
- auto cutOffCopyAt(s32 at, const T* src, s32 copy_length = -1) -> s32
- auto copyAtWithTerminate(s32 at, const T* src, s32 copy_length = -1) -> s32
- auto format(const T* format, ...) -> s32
- auto formatV(const T* format, std::va_list args) -> s32
- auto appendWithFormat(const T* format, ...) -> s32
- auto appendWithFormatV(const T* format, std::va_list args) -> s32
- auto append(const T* str, s32 append_length) -> s32
- Append append_length characters from str.
- auto append(T c) -> s32
- Append a character.
- auto append(T c, s32 n) -> s32
- Append a character n times.
- auto chop(s32 chop_num) -> s32
- auto chopMatchedChar(T c) -> s32
- auto chopMatchedChar(const T* characters) -> s32
- auto chopUnprintableAsciiChar() -> s32
- auto rstrip(const T* characters) -> s32
- auto rstripUnprintableAsciiChars() -> s32
- auto trim(s32 trim_length) -> s32
- auto trimMatchedString(const T* str) -> s32
- auto replaceChar(T old_char, T new_char) -> s32
- auto replaceCharList(const SafeStringBase<T>& old_chars, const SafeStringBase<T>& new_chars) -> s32
- auto convertFromMultiByteString(const char* str, s32 str_length) -> s32
- auto convertFromWideCharString(const char16* str, s32 str_length) -> s32
- auto cutOffAppend(const T* str, s32 append_length) -> s32
- auto cutOffAppend(T c, s32 num) -> s32
- auto prepend(const T* str, s32 prepend_length) -> s32
- auto prepend(T c, s32 num) -> s32
Protected static functions
- static auto createImpl_(s32 buffer_size, Heap* heap, s32 alignment) -> StringBuilderBase<T>*
- static auto formatImpl_(T* dst, s32 dst_size, const T* format, std::va_list arg) -> s32
Protected functions
-
template<typename OtherType>auto convertFromOtherType_(const OtherType* src, s32 src_size) -> s32
- auto getMutableStringTop_() const -> T*
Protected variables
Function documentation
template<typename T>
s32 sead:: StringBuilderBase<T>:: cutOffCopy(const T* src,
s32 copy_length = -1)
| Parameters | |
|---|---|
| src | Source string |
| copy_length | |
Copy up to copyLength characters to the beginning of the string, then writes NUL. Silently truncates the source string if the buffer is too small.
template<typename T>
s32 sead:: StringBuilderBase<T>:: cutOffCopyAt(s32 at,
const T* src,
s32 copy_length = -1)
| Parameters | |
|---|---|
| at | Start position (-1 for end of string) |
| src | Source string |
| copy_length | |
Copy up to copyLength characters to the specified position, then writes NUL if the copy makes this string longer. Silently truncates the source string if the buffer is too small.
template<typename T>
s32 sead:: StringBuilderBase<T>:: copyAtWithTerminate(s32 at,
const T* src,
s32 copy_length = -1)
| Parameters | |
|---|---|
| at | Start position (-1 for end of string) |
| src | Source string |
| copy_length | |
Copy up to copyLength characters to the specified position, then always writes NUL.
template<typename T>
s32 sead:: StringBuilderBase<T>:: chopMatchedChar(T c)
| Returns | the number of characters that were removed |
|---|
Remove the last character if it is equal to c.
template<typename T>
s32 sead:: StringBuilderBase<T>:: chopMatchedChar(const T* characters)
| Parameters | |
|---|---|
| characters | List of characters to remove |
| Returns | the number of characters that were removed |
Remove the last character if it is equal to any of the specified characters.
template<typename T>
s32 sead:: StringBuilderBase<T>:: chopUnprintableAsciiChar()
| Returns | the number of characters that were removed |
|---|
Remove the last character if it is unprintable.
template<typename T>
s32 sead:: StringBuilderBase<T>:: rstripUnprintableAsciiChars()
| Returns | the number of characters that were removed |
|---|
Remove trailing characters that are unprintable.
template<typename T>
s32 sead:: StringBuilderBase<T>:: trimMatchedString(const T* str)
| Returns | the new length |
|---|
Trim a string to only keep trimLength characters.
template<typename T>
s32 sead:: StringBuilderBase<T>:: replaceChar(T old_char,
T new_char)
| Returns | the number of characters that were replaced |
|---|
template<typename T>
s32 sead:: StringBuilderBase<T>:: replaceCharList(const SafeStringBase<T>& old_chars,
const SafeStringBase<T>& new_chars)
| Returns | the number of characters that were replaced |
|---|