Public Member Functions | |
StringBuffer (const StringBuffer &other) | |
template<size_t kOtherSizeBytes> | |
StringBuffer (const StringBuffer< kOtherSizeBytes > &other) | |
template<size_t kOtherSizeBytes> | |
StringBuffer & | operator= (const StringBuffer< kOtherSizeBytes > &other) |
StringBuffer & | operator= (const StringBuffer &other) |
template<size_t kOtherSizeBytes> | |
StringBuffer & | assign (const StringBuffer< kOtherSizeBytes > &other) |
StringBuffer (StringBuffer &&other)=delete | |
StringBuffers are not movable: the underlying data must be copied. | |
StringBuffer & | operator= (StringBuffer &&other)=delete |
StringBuffers are not movable: the underlying data must be copied. | |
template<typename... Args> | |
StringBuffer & | append (Args &&... args) |
template<typename T > | |
StringBuffer & | operator<< (T &&value) |
![]() | |
constexpr | StringBuilder (span< char > buffer) |
Creates an empty pw::StringBuilder . | |
StringBuilder (span< std::byte > buffer) | |
constexpr | StringBuilder (InlineString<> &string) |
StringBuilder (const StringBuilder &)=delete | |
StringBuilder & | operator= (const StringBuilder &)=delete |
const char * | data () const |
const char * | c_str () const |
std::string_view | view () const |
operator std::string_view () const | |
span< const std::byte > | as_bytes () const |
Status | status () const |
StatusWithSize | status_with_size () const |
Returns status() and size() as a StatusWithSize . | |
Status | last_status () const |
The status from the last operation. May be OK while status() is not OK. | |
bool | ok () const |
True if status() is OkStatus() . | |
bool | empty () const |
True if the string is empty. | |
size_t | size () const |
Returns the current length of the string, excluding the null terminator. | |
size_t | max_size () const |
Returns the maximum length of the string, excluding the null terminator. | |
void | clear () |
Clears the string and resets its error state. | |
void | clear_status () |
Sets the statuses to OkStatus() ;. | |
void | push_back (char ch) |
void | pop_back () |
StringBuilder & | append (size_t count, char ch) |
Appends the provided character count times. | |
StringBuilder & | append (const char *str, size_t count) |
StringBuilder & | append (const char *str) |
StringBuilder & | append (std::string_view str) |
Appends a std::string_view to the end of the StringBuilder . | |
StringBuilder & | append (std::string_view str, size_t pos, size_t count=std::string_view::npos) |
template<typename T > | |
StringBuilder & | operator<< (const T &value) |
StringBuilder & | operator<< (bool value) |
Provide a few additional operator<< overloads that reduce code size. | |
StringBuilder & | operator<< (char value) |
StringBuilder & | operator<< (std::nullptr_t) |
StringBuilder & | operator<< (Status status) |
StringBuilder & | Format (const char *format,...) |
StringBuilder & | FormatVaList (const char *format, va_list args) |
void | resize (size_t new_size) |
Static Public Member Functions | |
static constexpr size_t | max_size () |
Additional Inherited Members | |
![]() | |
constexpr | StringBuilder (span< char > buffer, const StringBuilder &other) |
Functions to support StringBuffer copies. | |
void | CopySizeAndStatus (const StringBuilder &other) |