Sane C++ Libraries
C++ Platform Abstraction Libraries
Loading...
Searching...
No Matches
SC::StringBuilderFor< T > Struct Template Reference

StringBuilder tied to a specific type, created through StringBuilder::create or StringBuilder::createForAppendingTo. More...

#include <StringBuilder.h>

Inheritance diagram for SC::StringBuilderFor< T >:
SC::StringBuilder

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.
 
- Public Member Functions inherited from SC::StringBuilder
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

- Public Types inherited from SC::StringBuilder
enum class  AppendHexCase {
  UpperCase ,
  LowerCase
}
 Option for StringBuilder::appendHex. More...
 
- Static Public Member Functions inherited from SC::StringBuilder
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.
 
- Protected Types inherited from SC::StringBuilder
enum  Flags {
  Clear ,
  Append
}
 
- Protected Member Functions inherited from SC::StringBuilder
 StringBuilder (IGrowableBuffer &ibuffer, StringEncoding encoding, Flags flags) noexcept
 
void initWithEncoding (IGrowableBuffer &bufferT, StringEncoding stringEncoding, Flags flags) noexcept
 
- Protected Attributes inherited from SC::StringBuilder
IGrowableBuffer * buffer = nullptr
 
StringEncoding encoding
 

Detailed Description

template<typename T>
struct SC::StringBuilderFor< T >

StringBuilder tied to a specific type, created through StringBuilder::create or StringBuilder::createForAppendingTo.

Member Function Documentation

◆ finalize()

template<typename T >
StringView SC::StringBuilderFor< T >::finalize ( )
inlinenoexcept

Finalizes the StringBuilder, returning the resulting StringView.

◆ view()

template<typename T >
StringView SC::StringBuilderFor< T >::view ( )
inlinenodiscardnoexcept

Returns the resulting StringView after finalize.

Warning
This method can be called only after finalize has been called

The documentation for this struct was generated from the following file: