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

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

#include <StringBuilder.h>

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

Public 类型

using Ptr = std::unique_ptr<StringBuilder>
 

Public 成员函数

 StringBuilder (size_t cap=STRING_BUFFER_SIZE_FACTOR) noexcept
 
 StringBuilder (const char *str) noexcept
 
- Public 成员函数 继承自 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 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
 去除两端空格
 
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 ()
 

额外继承的成员函数

- 静态 Public 成员函数 继承自 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 成员函数 继承自 sese::text::AbstractStringBuffer
void expansion (size_t new_size) noexcept
 字符串缓存
 
bool insertAt (int index, const char *data, size_t len)
 
- Protected 属性 继承自 sese::text::AbstractStringBuffer
size_t cap {}
 
size_t len = 0
 实际容量
 
char * buffer = nullptr
 字符串长度
 

详细描述

线程不安全的字符串缓存类

成员类型定义说明

◆ Ptr

构造及析构函数说明

◆ 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

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