template<s32 L>
al::WStringTmp class

Base classes

template<s32 L>
class sead::WFixedSafeString<L>

Constructors, destructors, conversion operators

WStringTmp(const char16* format, ...)
WStringTmp()
__attribute__((always_inline)) BufferedSafeStringBase(char16 *buffer
if(size<= 0)

Public functions

auto operator[](s32 idx) const -> const char16&
auto getBuffer() -> char16*
auto getBufferSize() const -> s32
auto copy(const SafeStringBase<char16>& src, s32 copyLength = -1) -> s32
auto copyAt(s32 at, const SafeStringBase<char16>& src, s32 copyLength = -1) -> s32
auto cutOffCopy(const SafeStringBase<char16>& src, s32 copyLength = -1) -> s32
auto cutOffCopyAt(s32 at, const SafeStringBase<char16>& src, s32 copyLength = -1) -> s32
auto copyAtWithTerminate(s32 at, const SafeStringBase<char16>& src, s32 copyLength = -1) -> s32
auto format(const char16* format, ...) -> s32
auto format(const char* formatStr, ...) -> s32
auto format(const char16* formatStr, ...) -> s32
auto format(const char* formatStr, ...) -> s32
auto format(const char16* formatStr, ...) -> s32
auto formatV(const char16* format, std::va_list args) -> s32
auto formatV(const char* formatStr, va_list args) -> s32
auto formatV(const char16* formatStr, va_list args) -> s32
auto formatV(const char* formatStr, va_list args) -> s32
auto formatV(const char16* formatStr, va_list args) -> s32
auto appendWithFormat(const char16* formatStr, ...) -> s32
auto appendWithFormat(const char* formatStr, ...) -> s32
auto appendWithFormat(const char16* formatStr, ...) -> s32
auto appendWithFormat(const char* format, ...) -> s32
auto appendWithFormat(const char16* format, ...) -> s32
auto appendWithFormatV(const char16* formatStr, std::va_list args) -> s32
auto appendWithFormatV(const char* formatStr, va_list args) -> s32
auto appendWithFormatV(const char16* formatStr, va_list args) -> s32
auto appendWithFormatV(const char* format, std::va_list args) -> s32
auto appendWithFormatV(const char16* format, std::va_list args) -> s32
auto append(const SafeStringBase<char16>& str, s32 append_length = -1) -> s32
Append append_length characters from str.
auto append(char16 c) -> s32
Append a character.
auto append(char16 c, s32 n) -> s32
Append a character n times.
auto prepend(const SafeStringBase<char16>& str, s32 prepend_length = -1) -> s32
auto chop(s32 num) -> s32
auto chopMatchedChar(char16 c) -> s32
auto chopMatchedChar(const char16* characters) -> s32
auto chopUnprintableAsciiChar() -> s32
auto rstrip(const char16* characters) -> s32
auto rstripUnprintableAsciiChars() -> s32
auto trim(s32 trim_length) -> s32
auto trimMatchedString(const SafeStringBase<char16>& suffix) -> s32
auto removeSuffix(const SafeStringBase<char16>& suffix) -> s32
auto replaceChar(char16 old_char, char16 new_char) -> s32
auto replaceCharList(const SafeStringBase<char16>& old_chars, const SafeStringBase<char16>& new_chars) -> s32
auto setReplaceString(const SafeStringBase<char16>& target_str, const SafeStringBase<char16>& old_str, const SafeStringBase<char16>& new_str) -> s32
auto replaceString(const SafeStringBase<char16>& old_str, const SafeStringBase<char16>& new_str) -> s32
auto convertFromMultiByteString(const SafeStringBase<char>& str, s32 str_length) -> s32
auto convertFromWideCharString(const SafeStringBase<char16>& str, s32 str_length) -> s32
void clear()

Public variables

char16 mBuffer
s32 size
else

Protected static functions

static auto formatImpl_(char16* dst, s32 dst_size, const char16* format, std::va_list arg) -> s32

Protected functions

void assureTerminationImpl_() const override
void assureTerminationImpl_() const
void assureTerminationImpl_() const
auto getMutableStringTop_() -> char16*
auto formatImpl_(char* s, s32 n, const char* formatStr, va_list args) -> s32
auto formatImpl_(char16* s, s32 n, const char16* formatStr, va_list args) -> s32
auto convertFromOtherType_(const SafeStringBase<OtherType>& src, s32 src_size) -> s32

Protected variables

s32 mBufferSize

Function documentation

template<s32 L>
al::WStringTmp<L>::__attribute__((always_inline)) BufferedSafeStringBase(char16 *buffer

template<s32 L>
al::WStringTmp<L>::if(size<= 0)

template<s32 L>
const char16& al::WStringTmp<L>::operator[](s32 idx) const

template<s32 L>
char16* al::WStringTmp<L>::getBuffer()

template<s32 L>
s32 al::WStringTmp<L>::getBufferSize() const

template<s32 L>
s32 al::WStringTmp<L>::copy(const SafeStringBase<char16>& src, s32 copyLength = -1)

Parameters
src Source string
copyLength Number of characters from src to copy (must not cause a buffer overflow)

Copy up to copyLength characters to the beginning of the string, then writes NUL.

template<s32 L>
s32 al::WStringTmp<L>::copyAt(s32 at, const SafeStringBase<char16>& src, s32 copyLength = -1)

Parameters
at Start position (-1 for end of string)
src Source string
copyLength Number of characters from src to copy (must not cause a buffer overflow)

Copy up to copyLength characters to the specified position, then writes NUL if the copy makes this string longer.

template<s32 L>
s32 al::WStringTmp<L>::cutOffCopy(const SafeStringBase<char16>& src, s32 copyLength = -1)

Parameters
src Source string
copyLength Number of characters from src to copy

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<s32 L>
s32 al::WStringTmp<L>::cutOffCopyAt(s32 at, const SafeStringBase<char16>& src, s32 copyLength = -1)

Parameters
at Start position (-1 for end of string)
src Source string
copyLength Number of characters from src to copy

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<s32 L>
s32 al::WStringTmp<L>::copyAtWithTerminate(s32 at, const SafeStringBase<char16>& src, s32 copyLength = -1)

Parameters
at Start position (-1 for end of string)
src Source string
copyLength Number of characters from src to copy (must not cause a buffer overflow)

Copy up to copyLength characters to the specified position, then always writes NUL.

template<s32 L>
s32 al::WStringTmp<L>::format(const char16* format, ...)

template<s32 L>
s32 al::WStringTmp<L>::format(const char* formatStr, ...)

template<s32 L>
s32 al::WStringTmp<L>::format(const char16* formatStr, ...)

template<s32 L>
s32 al::WStringTmp<L>::format(const char* formatStr, ...)

template<s32 L>
s32 al::WStringTmp<L>::format(const char16* formatStr, ...)

template<s32 L>
s32 al::WStringTmp<L>::formatV(const char16* format, std::va_list args)

template<s32 L>
s32 al::WStringTmp<L>::formatV(const char* formatStr, va_list args)

template<s32 L>
s32 al::WStringTmp<L>::formatV(const char16* formatStr, va_list args)

template<s32 L>
s32 al::WStringTmp<L>::formatV(const char* formatStr, va_list args)

template<s32 L>
s32 al::WStringTmp<L>::formatV(const char16* formatStr, va_list args)

template<s32 L>
s32 al::WStringTmp<L>::appendWithFormat(const char16* formatStr, ...)

template<s32 L>
s32 al::WStringTmp<L>::appendWithFormat(const char* formatStr, ...)

template<s32 L>
s32 al::WStringTmp<L>::appendWithFormat(const char16* formatStr, ...)

template<s32 L>
s32 al::WStringTmp<L>::appendWithFormat(const char* format, ...)

template<s32 L>
s32 al::WStringTmp<L>::appendWithFormat(const char16* format, ...)

template<s32 L>
s32 al::WStringTmp<L>::appendWithFormatV(const char16* formatStr, std::va_list args)

template<s32 L>
s32 al::WStringTmp<L>::appendWithFormatV(const char* formatStr, va_list args)

template<s32 L>
s32 al::WStringTmp<L>::appendWithFormatV(const char16* formatStr, va_list args)

template<s32 L>
s32 al::WStringTmp<L>::appendWithFormatV(const char* format, std::va_list args)

template<s32 L>
s32 al::WStringTmp<L>::appendWithFormatV(const char16* format, std::va_list args)

template<s32 L>
s32 al::WStringTmp<L>::append(const SafeStringBase<char16>& str, s32 append_length = -1)

Append append_length characters from str.

template<s32 L>
s32 al::WStringTmp<L>::append(char16 c)

Append a character.

template<s32 L>
s32 al::WStringTmp<L>::append(char16 c, s32 n)

Append a character n times.

template<s32 L>
s32 al::WStringTmp<L>::prepend(const SafeStringBase<char16>& str, s32 prepend_length = -1)

Returns the new length

Append prepend_length characters from str.

template<s32 L>
s32 al::WStringTmp<L>::chop(s32 num)

Returns the number of characters that were removed

Remove num characters from the end of the string.

template<s32 L>
s32 al::WStringTmp<L>::chopMatchedChar(char16 c)

Returns the number of characters that were removed

Remove the last character if it is equal to c.

template<s32 L>
s32 al::WStringTmp<L>::chopMatchedChar(const char16* 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<s32 L>
s32 al::WStringTmp<L>::chopUnprintableAsciiChar()

Returns the number of characters that were removed

Remove the last character if it is unprintable.

template<s32 L>
s32 al::WStringTmp<L>::rstrip(const char16* characters)

Parameters
characters List of characters to remove
Returns the number of characters that were removed

Remove trailing characters that are in the specified list.

template<s32 L>
s32 al::WStringTmp<L>::rstripUnprintableAsciiChars()

Returns the number of characters that were removed

Remove trailing characters that are unprintable.

template<s32 L>
s32 al::WStringTmp<L>::trim(s32 trim_length)

Returns the new length

Trim a string to only keep trimLength characters.

template<s32 L>
s32 al::WStringTmp<L>::trimMatchedString(const SafeStringBase<char16>& suffix)

Returns the new length

Remove the specified suffix from the string if it ends with the suffix.

template<s32 L>
s32 al::WStringTmp<L>::removeSuffix(const SafeStringBase<char16>& suffix)

Returns the new length

Remove the specified suffix from the string if it ends with the suffix. Alias of trimMatchedString.

template<s32 L>
s32 al::WStringTmp<L>::replaceChar(char16 old_char, char16 new_char)

Returns the number of characters that were replaced

template<s32 L>
s32 al::WStringTmp<L>::replaceCharList(const SafeStringBase<char16>& old_chars, const SafeStringBase<char16>& new_chars)

Returns the number of characters that were replaced

template<s32 L>
s32 al::WStringTmp<L>::setReplaceString(const SafeStringBase<char16>& target_str, const SafeStringBase<char16>& old_str, const SafeStringBase<char16>& new_str)

Returns the number of replaced occurrences

Set the contents of this string to target_str, after replacing occurrences of old_str in target_str with new_str.

template<s32 L>
s32 al::WStringTmp<L>::replaceString(const SafeStringBase<char16>& old_str, const SafeStringBase<char16>& new_str)

Returns the number of replaced occurrences

Replace occurrences of old_str in this string with new_str.

template<s32 L>
s32 al::WStringTmp<L>::convertFromMultiByteString(const SafeStringBase<char>& str, s32 str_length)

template<s32 L>
s32 al::WStringTmp<L>::convertFromWideCharString(const SafeStringBase<char16>& str, s32 str_length)

template<s32 L>
void al::WStringTmp<L>::clear()

template<s32 L>
static s32 al::WStringTmp<L>::formatImpl_(char16* dst, s32 dst_size, const char16* format, std::va_list arg) protected

template<s32 L>
void al::WStringTmp<L>::assureTerminationImpl_() const override protected

template<s32 L>
void al::WStringTmp<L>::assureTerminationImpl_() const protected

template<s32 L>
void al::WStringTmp<L>::assureTerminationImpl_() const protected

template<s32 L>
char16* al::WStringTmp<L>::getMutableStringTop_() protected

template<s32 L>
s32 al::WStringTmp<L>::formatImpl_(char* s, s32 n, const char* formatStr, va_list args) protected

template<s32 L>
s32 al::WStringTmp<L>::formatImpl_(char16* s, s32 n, const char16* formatStr, va_list args) protected

template<s32 L>
s32 al::WStringTmp<L>::convertFromOtherType_(const SafeStringBase<OtherType>& src, s32 src_size) protected

Variable documentation

template<s32 L>
char16 al::WStringTmp<L>::mBuffer

template<s32 L>
s32 al::WStringTmp<L>::size

template<s32 L>
al::WStringTmp<L>::else

template<s32 L>
s32 al::WStringTmp<L>::mBufferSize protected