Sese Framework  x.y.z
A cross-platform framework
载入中...
搜索中...
未找到
sese::text::StringBuffer类 参考final

线程安全的字符串缓存类 更多...

#include <StringBuffer.h>

类 sese::text::StringBuffer 继承关系图:
sese::text::AbstractStringBuffer

Public 类型

using Ptr = std::unique_ptr<StringBuffer>
 

Public 成员函数

 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
 去除两端空格
 
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 成员函数

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 成员函数 继承自 sese::text::AbstractStringBuffer
 AbstractStringBuffer (size_t cap=STRING_BUFFER_SIZE_FACTOR) noexcept
 
 AbstractStringBuffer (const char *str) noexcept
 以字符串为初始化参数
 
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
 字符串缓存
 
bool insertAt (int index, const char *data, size_t len)
 

静态 Private 成员函数

static std::vector< std::string > split (const std::string_view &text, const std::string_view &sub) noexcept
 
- 静态 Private 成员函数 继承自 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 属性

std::mutex mutex
 
- Private 属性 继承自 sese::text::AbstractStringBuffer
size_t cap {}
 
size_t len = 0
 实际容量
 
char * buffer = nullptr
 字符串长度
 

详细描述

线程安全的字符串缓存类

成员类型定义说明

◆ Ptr

using sese::text::StringBuffer::Ptr = std::unique_ptr<StringBuffer>

构造及析构函数说明

◆ StringBuffer() [1/2]

sese::text::StringBuffer::StringBuffer ( size_t cap = STRING_BUFFER_SIZE_FACTOR)
explicitnoexcept

◆ StringBuffer() [2/2]

sese::text::StringBuffer::StringBuffer ( const char * str)
explicitnoexcept

成员函数说明

◆ append() [1/7]

void sese::text::StringBuffer::append ( char ch)
overridevirtualnoexcept

◆ append() [2/7]

void sese::text::StringBuffer::append ( const char * data,
size_t length )
overridevirtualnoexcept

◆ append() [3/7]

void sese::text::StringBuffer::append ( const char * str)
overridevirtualnoexcept

◆ append() [4/7]

void sese::text::StringBuffer::append ( const std::string & str)
overridevirtualnoexcept

◆ append() [5/7]

void sese::text::StringBuffer::append ( const std::string_view & str)
overridevirtualnoexcept

◆ append() [6/7]

void sese::text::StringBuffer::append ( const String & str)
overridevirtualnoexcept

◆ append() [7/7]

void sese::text::StringBuffer::append ( const StringView & str)
overridevirtualnoexcept

◆ clear()

void sese::text::StringBuffer::clear ( )
overridevirtualnoexcept

◆ del()

bool sese::text::StringBuffer::del ( int start,
int len )
overridevirtual

◆ delCharAt()

bool sese::text::StringBuffer::delCharAt ( int index)
overridevirtual

◆ empty() [1/2]

virtual bool sese::text::AbstractStringBuffer::empty ( ) const
inlinenodiscardprivatevirtualnoexcept

◆ empty() [2/2]

bool sese::text::StringBuffer::empty ( )
nodiscardnoexcept

◆ endsWith()

bool sese::text::StringBuffer::endsWith ( const std::string_view & suffix)
nodiscardnoexcept

◆ getCharAt() [1/2]

char sese::text::StringBuffer::getCharAt ( int index)
nodiscard

◆ getCharAt() [2/2]

char sese::text::AbstractStringBuffer::getCharAt ( int index) const
nodiscardprivatevirtual

◆ insertAt() [1/5]

bool sese::text::StringBuffer::insertAt ( int index,
const char * str )
overridevirtual

◆ insertAt() [2/5]

bool sese::text::StringBuffer::insertAt ( int index,
const std::string & str )
overridevirtual

◆ insertAt() [3/5]

bool sese::text::StringBuffer::insertAt ( int index,
const std::string_view & str )
overridevirtual

◆ insertAt() [4/5]

bool sese::text::StringBuffer::insertAt ( int index,
const String & str )
overridevirtual

◆ insertAt() [5/5]

bool sese::text::StringBuffer::insertAt ( int index,
const StringView & str )
overridevirtual

◆ length() [1/2]

virtual size_t sese::text::AbstractStringBuffer::length ( ) const
inlinenodiscardprivatevirtualnoexcept

◆ length() [2/2]

size_t sese::text::StringBuffer::length ( )
nodiscardnoexcept

◆ reverse()

void sese::text::StringBuffer::reverse ( )
overridevirtualnoexcept

◆ setChatAt()

bool sese::text::StringBuffer::setChatAt ( int index,
char ch )
overridevirtual

◆ size() [1/2]

virtual size_t sese::text::AbstractStringBuffer::size ( ) const
inlinenodiscardprivatevirtualnoexcept

◆ size() [2/2]

size_t sese::text::StringBuffer::size ( )
nodiscardnoexcept

◆ split() [1/3]

std::vector< std::string > sese::text::StringBuffer::split ( const std::string & str)
nodiscardnoexcept

◆ split() [2/3]

std::vector< std::string > sese::text::AbstractStringBuffer::split ( const std::string_view & str) const
nodiscardprivatevirtualnoexcept

◆ split() [3/3]

std::vector< std::string > sese::text::AbstractStringBuffer::split ( const std::string_view & text,
const std::string_view & sub )
staticprivatenoexcept

◆ startsWith()

bool sese::text::StringBuffer::startsWith ( const std::string_view & prefix)
nodiscardnoexcept

◆ toSString()

sese::text::String sese::text::StringBuffer::toSString ( )
overridevirtual

◆ toString()

std::string sese::text::StringBuffer::toString ( )
overridevirtual

◆ trim()

void sese::text::StringBuffer::trim ( )
overridevirtualnoexcept

类成员变量说明

◆ mutex

std::mutex sese::text::StringBuffer::mutex
private

被这些函数引用 clear().


该类的文档由以下文件生成: