Sese Framework  2.3.0
A cross-platform framework
Loading...
Searching...
No Matches
sese::text::StringBuilder Class Referencefinal

Non-thread-safe string buffer class. More...

#include <StringBuilder.h>

Inheritance diagram for sese::text::StringBuilder:
sese::text::AbstractStringBuffer

Public Types

using Ptr = std::unique_ptr<StringBuilder>
 

Public Member Functions

 StringBuilder (size_t cap=STRING_BUFFER_SIZE_FACTOR) noexcept
 
 StringBuilder (const char *str) noexcept
 
- Public Member Functions inherited from sese::text::AbstractStringBuffer
 AbstractStringBuffer (size_t cap=STRING_BUFFER_SIZE_FACTOR) noexcept
 
 AbstractStringBuffer (const char *str) noexcept
 Initialize with a string.
 
virtual ~AbstractStringBuffer () noexcept
 
 AbstractStringBuffer (const AbstractStringBuffer &abstract_string_buffer) noexcept
 
 AbstractStringBuffer (AbstractStringBuffer &&abstract_string_buffer) noexcept
 
virtual void append (char ch) noexcept
 
virtual void append (const char *str) noexcept
 
virtual void append (const std::string &str) noexcept
 
virtual void append (const std::string_view &str) noexcept
 
virtual void append (const String &str) noexcept
 
virtual void append (const StringView &view) noexcept
 
virtual void append (const char *data, size_t len) noexcept
 
virtual size_t length () const noexcept
 
virtual size_t size () const noexcept
 
virtual bool empty () const noexcept
 
virtual void clear () noexcept
 
virtual void reverse () noexcept
 
virtual char getCharAt (int index) const
 
virtual bool setChatAt (int index, char ch)
 
virtual bool delCharAt (int index)
 
virtual bool del (int start, int l)
 
virtual bool insertAt (int index, const char *str)
 
virtual bool insertAt (int index, const std::string &str)
 
virtual bool insertAt (int index, const std::string_view &str)
 
virtual bool insertAt (int index, const String &str)
 
virtual bool insertAt (int index, const StringView &view)
 
virtual void trim () noexcept
 Remove whitespace at both ends.
 
virtual std::vector< std::string > split (const std::string_view &str) const noexcept
 
virtual bool startsWith (const std::string_view &prefix) const noexcept
 
virtual bool endsWith (const std::string_view &suffix) const noexcept
 
virtual std::string toString ()
 
virtual String toSString ()
 
virtual void * buf ()
 

Additional Inherited Members

- Static Public Member Functions inherited from sese::text::AbstractStringBuffer
static std::vector< std::string > split (const std::string_view &text, const std::string_view &sub) noexcept
 
static bool startsWith (const std::string_view &text, const std::string_view &prefix) noexcept
 
static bool endsWith (const std::string_view &text, const std::string_view &suffix) noexcept
 
- Protected Member Functions inherited from sese::text::AbstractStringBuffer
void expansion (size_t new_size) noexcept
 String caching.
 
bool insertAt (int index, const char *data, size_t len)
 
- Protected Attributes inherited from sese::text::AbstractStringBuffer
size_t cap {}
 
size_t len = 0
 Actual capacity.
 
char * buffer = nullptr
 String length.
 

Detailed Description

Non-thread-safe string buffer class.

Member Typedef Documentation

◆ Ptr

Constructor & Destructor Documentation

◆ StringBuilder() [1/2]

sese::text::StringBuilder::StringBuilder ( size_t cap = STRING_BUFFER_SIZE_FACTOR)
inlineexplicitnoexcept

◆ StringBuilder() [2/2]

sese::text::StringBuilder::StringBuilder ( const char * str)
inlineexplicitnoexcept

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