StringBuilder tied to a specific type, created through StringBuilder::create or StringBuilder::createForAppendingTo. More...
#include <StringBuilder.h>
Public Member Functions | |
StringBuilderFor (T &stringOrBuffer, Flags flags) noexcept | |
StringView | finalize () noexcept |
Finalizes the StringBuilder, returning the resulting StringView. | |
StringView | view () noexcept |
Returns the resulting StringView after finalize. | |
![]() | |
template<typename... Types> | |
bool | append (StringView fmt, Types &&... args) |
Formats the given StringView against args, appending to destination contents. | |
bool | append (StringView str) |
Appends StringView to destination buffer. | |
bool | appendReplaceAll (StringView source, StringView occurrencesOf, StringView with) |
Appends source to destination buffer, replacing occurrencesOf StringView with StringView with | |
bool | appendHex (Span< const uint8_t > data, AppendHexCase casing) |
Appends given binary data escaping it as hexadecimal ASCII characters. | |
Public Attributes | |
GrowableBuffer< T > | growableBuffer |
StringView | finalizedView |
Additional Inherited Members | |
![]() | |
enum class | AppendHexCase { UpperCase , LowerCase } |
Option for StringBuilder::appendHex. More... | |
![]() | |
template<typename T > | |
static StringBuilderFor< T > | create (T &stringOrBuffer) noexcept |
Creates a StringBuilder for the given string or buffer, replacing its current contents. | |
template<typename T > | |
static StringBuilderFor< T > | createForAppendingTo (T &stringOrBuffer) noexcept |
Creates a StringBuilder for the given string or buffer, appending to its current contents. | |
template<typename T , typename... Types> | |
static bool | format (T &buffer, StringView fmt, Types &&... args) |
Helper to format a StringView against args, replacing destination contents, in a single function call. | |
![]() | |
enum | Flags { Clear , Append } |
![]() | |
StringBuilder (IGrowableBuffer &ibuffer, StringEncoding encoding, Flags flags) noexcept | |
void | initWithEncoding (IGrowableBuffer &bufferT, StringEncoding stringEncoding, Flags flags) noexcept |
![]() | |
IGrowableBuffer * | buffer = nullptr |
StringEncoding | encoding |
StringBuilder tied to a specific type, created through StringBuilder::create or StringBuilder::createForAppendingTo.
|
inlinenoexcept |
Finalizes the StringBuilder, returning the resulting StringView.
|
inlinenodiscardnoexcept |
Returns the resulting StringView after finalize.