High-performance string builder with fluent interface and efficient memory management.
More...
|
|
| StringBuilder ()=delete |
| | Default constructor.
|
| |
|
| StringBuilder (const StringBuilder &)=default |
| | Copy constructor.
|
| |
|
| StringBuilder (StringBuilder &&) noexcept=delete |
| | Move constructor.
|
| |
|
| ~StringBuilder ()=default |
| | Destructor.
|
| |
|
StringBuilder & | operator= (const StringBuilder &)=delete |
| | Copy assignment operator.
|
| |
|
StringBuilder & | operator= (StringBuilder &&) noexcept=delete |
| | Move assignment operator.
|
| |
| char & | operator[] (size_t index) |
| | Provides read-write access to character at specified index.
|
| |
| const char & | operator[] (size_t index) const |
| | Provides read-only access to character at specified index.
|
| |
| void | append (std::string_view str) |
| | Appends string_view contents to the buffer efficiently.
|
| |
| void | append (const std::string &str) |
| | Appends std::string contents to the buffer.
|
| |
| void | append (const char *str) |
| | Appends null-terminated C-string to the buffer.
|
| |
| void | push_back (char c) |
| | Appends single character to the buffer.
|
| |
| StringBuilder & | operator<< (std::string_view str) |
| | Stream operator for string_view.
|
| |
| StringBuilder & | operator<< (const std::string &str) |
| | Stream operator for std::string.
|
| |
| StringBuilder & | operator<< (const char *str) |
| | Stream operator for C-string.
|
| |
| StringBuilder & | operator<< (char c) |
| | Stream operator for single character.
|
| |
| size_t | length () const noexcept |
| | Returns current buffer size in characters.
|
| |
| void | resize (size_t newSize) |
| | Resizes buffer to specified character count.
|
| |
| iterator | begin () |
| | Returns mutable iterator to beginning of character sequence.
|
| |
| const_iterator | begin () const |
| | Returns const iterator to beginning of character sequence.
|
| |
| iterator | end () |
| | Returns mutable iterator to end of character sequence.
|
| |
| const_iterator | end () const |
| | Returns const iterator to end of character sequence.
|
| |
High-performance string builder with fluent interface and efficient memory management.
Provides a convenient wrapper around DynamicStringBuffer with stream-like operators for intuitive string construction. Features efficient append operations, iterator support, and automatic memory management through the underlying buffer.
- Note
- This class is a lightweight wrapper that references an underlying DynamicStringBuffer. It does not own the buffer memory - use StringBuilderPool::lease() for proper RAII management.
- Warning
- Not thread-safe - external synchronization required for concurrent access. Multiple StringBuilder instances should not reference the same buffer concurrently.
- See also
- StringBuilderPool for the recommended way to obtain StringBuilder instances
-
StringBuilderLease for RAII management of pooled buffers
-
DynamicStringBuffer for the underlying buffer implementation
Definition at line 422 of file StringBuilderPool.h.