Sese Framework
2.3.0
A cross-platform framework
|
Thread-safe string buffer class. More...
#include <StringBuffer.h>
Public Types | |
using | Ptr = std::unique_ptr<StringBuffer> |
Public Member Functions | |
StringBuffer (size_t cap=STRING_BUFFER_SIZE_FACTOR) noexcept | |
StringBuffer (const char *str) noexcept | |
void | append (char ch) noexcept override |
void | append (const char *str) noexcept override |
void | append (const std::string &str) noexcept override |
void | append (const std::string_view &str) noexcept override |
void | append (const String &str) noexcept override |
void | append (const StringView &str) noexcept override |
void | append (const char *data, size_t length) noexcept override |
size_t | length () noexcept |
size_t | size () noexcept |
bool | empty () noexcept |
void | clear () noexcept override |
void | reverse () noexcept override |
char | getCharAt (int index) |
bool | setChatAt (int index, char ch) override |
bool | delCharAt (int index) override |
bool | del (int start, int len) override |
bool | insertAt (int index, const char *str) override |
bool | insertAt (int index, const std::string &str) override |
bool | insertAt (int index, const std::string_view &str) override |
bool | insertAt (int index, const String &str) override |
bool | insertAt (int index, const StringView &str) override |
void | trim () noexcept override |
Remove whitespace at both ends. | |
std::vector< std::string > | split (const std::string &str) noexcept |
bool | startsWith (const std::string_view &prefix) noexcept |
bool | endsWith (const std::string_view &suffix) noexcept |
std::string | toString () override |
String | toSString () override |
Private Member Functions | |
virtual bool | empty () const noexcept |
virtual char | getCharAt (int index) const |
virtual size_t | length () const noexcept |
virtual size_t | size () const noexcept |
virtual std::vector< std::string > | split (const std::string_view &str) const noexcept |
Private 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 bool | startsWith (const std::string_view &prefix) const noexcept |
virtual bool | endsWith (const std::string_view &suffix) const noexcept |
virtual void * | buf () |
void | expansion (size_t new_size) noexcept |
String caching. | |
bool | insertAt (int index, const char *data, size_t len) |
Static Private Member Functions | |
static std::vector< std::string > | split (const std::string_view &text, const std::string_view &sub) noexcept |
Static Private 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 |
Private Attributes | |
std::mutex | mutex |
Private Attributes inherited from sese::text::AbstractStringBuffer | |
size_t | cap {} |
size_t | len = 0 |
Actual capacity. | |
char * | buffer = nullptr |
String length. | |
Thread-safe string buffer class.
using sese::text::StringBuffer::Ptr = std::unique_ptr<StringBuffer> |
|
explicitnoexcept |
|
explicitnoexcept |
|
overridevirtualnoexcept |
Reimplemented from sese::text::AbstractStringBuffer.
Referenced by operator<<(), operator<<(), operator<<(), operator<<(), operator<<(), and operator<<().
|
overridevirtualnoexcept |
Reimplemented from sese::text::AbstractStringBuffer.
|
overridevirtualnoexcept |
Reimplemented from sese::text::AbstractStringBuffer.
|
overridevirtualnoexcept |
Reimplemented from sese::text::AbstractStringBuffer.
|
overridevirtualnoexcept |
Reimplemented from sese::text::AbstractStringBuffer.
|
overridevirtualnoexcept |
Reimplemented from sese::text::AbstractStringBuffer.
|
overridevirtualnoexcept |
Reimplemented from sese::text::AbstractStringBuffer.
|
overridevirtualnoexcept |
Reimplemented from sese::text::AbstractStringBuffer.
References sese::text::AbstractStringBuffer::clear(), and mutex.
|
overridevirtual |
Reimplemented from sese::text::AbstractStringBuffer.
References sese::text::AbstractStringBuffer::del().
|
overridevirtual |
Reimplemented from sese::text::AbstractStringBuffer.
References sese::text::AbstractStringBuffer::delCharAt().
|
inlinenodiscardprivatevirtualnoexcept |
Reimplemented from sese::text::AbstractStringBuffer.
|
nodiscardnoexcept |
References sese::text::AbstractStringBuffer::empty().
|
nodiscardnoexcept |
References sese::text::AbstractStringBuffer::endsWith().
|
nodiscard |
References sese::text::AbstractStringBuffer::getCharAt().
|
nodiscardprivatevirtual |
Reimplemented from sese::text::AbstractStringBuffer.
|
overridevirtual |
Reimplemented from sese::text::AbstractStringBuffer.
References sese::text::AbstractStringBuffer::insertAt().
|
overridevirtual |
Reimplemented from sese::text::AbstractStringBuffer.
References sese::text::AbstractStringBuffer::insertAt().
|
overridevirtual |
Reimplemented from sese::text::AbstractStringBuffer.
References sese::text::AbstractStringBuffer::insertAt().
|
overridevirtual |
Reimplemented from sese::text::AbstractStringBuffer.
References sese::text::AbstractStringBuffer::insertAt().
|
overridevirtual |
Reimplemented from sese::text::AbstractStringBuffer.
References sese::text::AbstractStringBuffer::insertAt().
|
inlinenodiscardprivatevirtualnoexcept |
Reimplemented from sese::text::AbstractStringBuffer.
|
nodiscardnoexcept |
References sese::text::AbstractStringBuffer::length().
|
overridevirtualnoexcept |
Reimplemented from sese::text::AbstractStringBuffer.
References sese::text::AbstractStringBuffer::reverse().
|
overridevirtual |
Reimplemented from sese::text::AbstractStringBuffer.
References sese::text::AbstractStringBuffer::setChatAt().
|
inlinenodiscardprivatevirtualnoexcept |
Reimplemented from sese::text::AbstractStringBuffer.
|
nodiscardnoexcept |
References sese::text::AbstractStringBuffer::size().
|
nodiscardnoexcept |
References sese::text::AbstractStringBuffer::split().
|
nodiscardprivatevirtualnoexcept |
Reimplemented from sese::text::AbstractStringBuffer.
|
staticprivatenoexcept |
|
nodiscardnoexcept |
References sese::text::AbstractStringBuffer::startsWith().
|
overridevirtual |
Reimplemented from sese::text::AbstractStringBuffer.
References sese::text::AbstractStringBuffer::toSString().
|
overridevirtual |
Reimplemented from sese::text::AbstractStringBuffer.
References sese::text::AbstractStringBuffer::toString().
|
overridevirtualnoexcept |
Remove whitespace at both ends.
Reimplemented from sese::text::AbstractStringBuffer.
References sese::text::AbstractStringBuffer::trim().
|
private |
Referenced by clear().