4#include "../Strings/StringConverter.h"
5#include "../Strings/StringFormat.h"
46 template <
typename... Types>
47 [[nodiscard]]
bool format(
StringView fmt, Types&&... args);
63 template <
typename... Types>
64 [[nodiscard]]
bool append(
StringView fmt, Types&&... args);
121 StringEncoding encoding;
130template <
typename... Types>
137template <
typename... Types>
144 const bool hadNullTerminator = StringConverter::popNullTermIfNotEmpty(stringData, encoding);
154 if (hadNullTerminator)
157 (void)StringConverter::pushNullTerm(stringData, encoding);
constexpr T && forward(typename TypeTraits::RemoveReference< T >::type &value)
Forwards an lvalue or an rvalue as an rvalue reference.
Definition Compiler.h:260
An heap allocated byte buffer that can optionally use an inline buffer.
Definition Buffer.h:29
View over a contiguous sequence of items (pointer + size in elements).
Definition Span.h:29
Holds a search / replace pair for StringBuilder::appendReplaceMultiple.
Definition StringBuilder.h:88
StringView replaceWith
StringView to be searched for in source string.
Definition StringBuilder.h:90
Builds String out of a sequence of StringView or formatting through StringFormat.
Definition StringBuilder.h:16
StringBuilder(Buffer &stringData, StringEncoding encoding, Flags flags=DoNotClear)
Create a StringBuilder that will push to given Vector, with specific encoding.
bool format(StringView fmt, Types &&... args)
Uses StringFormat to format the given StringView against args, replacing destination contents.
Definition StringBuilder.h:131
Flags
Clearing flags used when initializing destination buffer.
Definition StringBuilder.h:19
@ Clear
Destination buffer will be cleared before pushing to it.
Definition StringBuilder.h:20
bool append(StringView str)
Appends StringView to destination buffer.
AppendHexCase
Option for StringBuilder::appendHex.
Definition StringBuilder.h:104
bool appendHex(Span< const uint8_t > data, AppendHexCase casing)
Appends given binary data escaping it as hexadecimal ASCII characters.
bool appendReplaceAll(StringView source, StringView occurrencesOf, StringView with)
Appends source to destination buffer, replacing occurrencesOf StringView with StringView with
bool appendReplaceMultiple(StringView source, Span< const ReplacePair > substitutions)
Appends source to destination buffer, replacing multiple substitutions pairs.
bool format(StringView text)
Assigns StringView to destination buffer.
StringBuilder(String &str, Flags flags=DoNotClear)
Create a StringBuilder that will push to given String, with specific encoding.
bool append(StringView fmt, Types &&... args)
Uses StringFormat to format the given StringView against args, appending to destination contents.
Definition StringBuilder.h:138
constexpr StringEncoding getEncoding() const
Get encoding of this StringView.
Definition StringSpan.h:83
Non-owning view over a range of characters with UTF Encoding.
Definition StringView.h:46
A non-modifiable owning string with associated encoding.
Definition String.h:29