Sese Framework
2.3.0
A cross-platform framework
|
String buffer class. More...
#include <AbstractStringBuffer.h>
Public Member Functions | |
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 () |
Static Public Member Functions | |
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 | |
void | expansion (size_t new_size) noexcept |
String caching. | |
bool | insertAt (int index, const char *data, size_t len) |
Protected Attributes | |
size_t | cap {} |
size_t | len = 0 |
Actual capacity. | |
char * | buffer = nullptr |
String length. | |
String buffer class.
|
explicitnoexcept |
cap | Initial capacity |
|
explicitnoexcept |
|
virtualnoexcept |
References buffer.
|
noexcept |
|
noexcept |
|
virtualnoexcept |
Reimplemented in sese::text::StringBuffer.
References append().
Referenced by append(), append(), append(), append(), append(), append(), sese::Exception::buildStacktrace(), sese::xml::XmlUtil::createElement(), sese::db::impl::PostgresDriverInstanceImpl::createStatement(), sese::PercentConverter::decode(), sese::SymbolConverter::decodeUnixClassName(), sese::net::dns::DnsPackage::decodeWords(), sese::record::SimpleFormatter::dump(), sese::PercentConverter::encode(), sese::net::dns::DnsPackage::encodeWords(), sese::net::dns::DnsPackage::Index::encodeWords(), sese::text::FormatOption_FloatNumberFormat(), sese::net::http::HttpUtil::getLine(), sese::net::http::RequestHeader::getUrl(), sese::RandomUtil::nextString(), operator<<(), operator<<(), operator<<(), operator<<(), operator<<(), operator<<(), sese::io::InputStreamReader::readLine(), sese::Json::simdParse(), sese::Json::tokenizer(), sese::xml::XmlUtil::tokenizer(), and sese::Value::writeSpace().
|
virtualnoexcept |
Reimplemented in sese::text::StringBuffer.
References STRING_BUFFER_SIZE_FACTOR.
|
virtualnoexcept |
Reimplemented in sese::text::StringBuffer.
References append().
|
virtualnoexcept |
Reimplemented in sese::text::StringBuffer.
References append().
|
virtualnoexcept |
Reimplemented in sese::text::StringBuffer.
References append().
|
virtualnoexcept |
Reimplemented in sese::text::StringBuffer.
References append(), and sstr::SStringView::len().
|
virtualnoexcept |
Reimplemented in sese::text::StringBuffer.
References append().
|
virtual |
References buffer.
Referenced by sese::system::Process::ProcessImpl::createEx(), and sese::Json::simdParse().
|
virtualnoexcept |
Reimplemented in sese::text::StringBuffer.
References len.
Referenced by sese::text::StringBuffer::clear(), sese::CSVReader::read(), sese::io::InputStreamReader::readLine(), sese::net::http::HttpUtil::recvRequest(), sese::net::http::HttpUtil::recvResponse(), sese::Json::tokenizer(), sese::xml::XmlUtil::tokenizer(), and sese::Yaml::tokenizer().
|
virtual |
Reimplemented in sese::text::StringBuffer.
Referenced by sese::text::StringBuffer::del().
|
virtual |
Reimplemented in sese::text::StringBuffer.
References buffer, CheckRange, and len.
Referenced by sese::text::StringBuffer::delCharAt().
|
inlinenodiscardvirtualnoexcept |
Reimplemented in sese::text::StringBuffer.
References len.
Referenced by sese::text::StringBuffer::empty(), sese::Value::List::empty(), sese::Yaml::getLine(), sese::CSVReader::read(), sese::io::InputStreamReader::readLine(), and sese::xml::XmlUtil::tokenizer().
|
nodiscardvirtualnoexcept |
|
staticnoexcept |
Referenced by sese::text::StringBuffer::endsWith().
|
protectednoexcept |
|
nodiscardvirtual |
Reimplemented in sese::text::StringBuffer.
References buffer, cap, and CheckRange.
Referenced by sese::text::StringBuffer::getCharAt().
|
protected |
References buffer, cap, expansion(), len, and STRING_BUFFER_SIZE_FACTOR.
Referenced by insertAt(), insertAt(), insertAt(), insertAt(), insertAt(), sese::text::StringBuffer::insertAt(), sese::text::StringBuffer::insertAt(), sese::text::StringBuffer::insertAt(), sese::text::StringBuffer::insertAt(), and sese::text::StringBuffer::insertAt().
|
virtual |
Reimplemented in sese::text::StringBuffer.
References insertAt().
|
virtual |
Reimplemented in sese::text::StringBuffer.
References insertAt().
|
virtual |
Reimplemented in sese::text::StringBuffer.
References insertAt().
|
virtual |
Reimplemented in sese::text::StringBuffer.
References insertAt(), and sstr::SStringView::len().
|
virtual |
Reimplemented in sese::text::StringBuffer.
References sstr::SStringView::data(), insertAt(), and sstr::SStringView::len().
|
inlinenodiscardvirtualnoexcept |
Reimplemented in sese::text::StringBuffer.
References len.
Referenced by sese::text::StringBuffer::length(), and sese::Json::simdParse().
|
virtualnoexcept |
Reimplemented in sese::text::StringBuffer.
Referenced by sese::text::StringBuffer::reverse().
|
virtual |
Reimplemented in sese::text::StringBuffer.
References buffer, cap, and CheckRange.
Referenced by sese::text::StringBuffer::setChatAt().
|
inlinenodiscardvirtualnoexcept |
Reimplemented in sese::text::StringBuffer.
References cap.
Referenced by sese::system::Process::ProcessImpl::createEx(), and sese::text::StringBuffer::size().
|
nodiscardvirtualnoexcept |
Reimplemented in sese::text::StringBuffer.
|
staticnoexcept |
Referenced by sese::net::dns::DnsPackage::encodeWords(), sese::net::http::RequestHeader::getUrl(), sese::net::http::Range::parse(), sese::net::http::RequestParser::parse(), sese::net::http::RequestParser::parseAddress(), sese::net::http::HttpUtil::parseFromCookie(), sese::text::DateTimeFormatter::parseFromISO8601(), sese::net::http::HttpUtil::parseFromSetCookie(), sese::net::http::HttpUtil::recvRequest(), sese::net::http::HttpUtil::recvResponse(), sese::net::http::RequestHeader::setUrl(), sese::text::StringBuffer::split(), and sese::db::tokenize().
|
nodiscardvirtualnoexcept |
|
staticnoexcept |
|
virtual |
Reimplemented in sese::text::StringBuffer.
Referenced by sese::text::StringBuffer::toSString().
|
virtual |
Reimplemented in sese::text::StringBuffer.
Referenced by sese::net::http::HPackUtil::buildCookieString(), sese::xml::XmlUtil::createElement(), sese::db::impl::PostgresDriverInstanceImpl::createStatement(), sese::PercentConverter::decode(), sese::SymbolConverter::decodeUnixClassName(), sese::net::dns::DnsPackage::decodeWords(), sese::record::SimpleFormatter::dump(), sese::PercentConverter::encode(), sese::net::dns::DnsPackage::encodeWords(), sese::net::dns::DnsPackage::Index::encodeWords(), sese::text::fmt(), sese::text::for_each(), sese::Yaml::getLine(), sese::net::http::RequestHeader::getUrl(), sese::RandomUtil::nextString(), sese::CSVReader::read(), sese::io::InputStreamReader::readLine(), sese::text::Number::toHex(), sese::text::Number::toHex(), sese::Json::tokenizer(), sese::xml::XmlUtil::tokenizer(), sese::Yaml::tokenizer(), sese::text::Number::toOct(), sese::text::Number::toOct(), sese::text::Number::toString(), sese::text::StringBuffer::toString(), and sese::Value::toString().
|
virtualnoexcept |
Remove whitespace at both ends.
Reimplemented in sese::text::StringBuffer.
References buffer, sese::isSpace(), and len.
Referenced by sese::text::StringBuffer::trim().
|
protected |
String length.
Referenced by buf(), del(), delCharAt(), getCharAt(), insertAt(), reverse(), setChatAt(), toSString(), toString(), trim(), and ~AbstractStringBuffer().
|
protected |
Referenced by getCharAt(), insertAt(), setChatAt(), and size().
|
protected |
Actual capacity.
Referenced by clear(), del(), delCharAt(), empty(), insertAt(), length(), reverse(), toSString(), toString(), and trim().