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

字符串缓冲类 更多...

#include <AbstractStringBuffer.h>

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

Public 成员函数

 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 成员函数

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 成员函数

void expansion (size_t new_size) noexcept
 字符串缓存
 
bool insertAt (int index, const char *data, size_t len)
 

Protected 属性

size_t cap {}
 
size_t len = 0
 实际容量
 
char * buffer = nullptr
 字符串长度
 

详细描述

字符串缓冲类

构造及析构函数说明

◆ AbstractStringBuffer() [1/4]

sese::text::AbstractStringBuffer::AbstractStringBuffer ( size_t cap = STRING_BUFFER_SIZE_FACTOR)
explicitnoexcept
参数
cap初始容量

◆ AbstractStringBuffer() [2/4]

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

以字符串为初始化参数

参数
str字符串

引用了 STRING_BUFFER_SIZE_FACTOR.

◆ ~AbstractStringBuffer()

sese::text::AbstractStringBuffer::~AbstractStringBuffer ( )
virtualnoexcept

引用了 buffer.

◆ AbstractStringBuffer() [3/4]

sese::text::AbstractStringBuffer::AbstractStringBuffer ( const AbstractStringBuffer & abstract_string_buffer)
noexcept

◆ AbstractStringBuffer() [4/4]

sese::text::AbstractStringBuffer::AbstractStringBuffer ( AbstractStringBuffer && abstract_string_buffer)
noexcept

成员函数说明

◆ append() [1/7]

◆ append() [2/7]

void sese::text::AbstractStringBuffer::append ( const char * data,
size_t len )
virtualnoexcept

◆ append() [3/7]

void sese::text::AbstractStringBuffer::append ( const char * str)
virtualnoexcept

sese::text::StringBuffer 重载.

引用了 append().

◆ append() [4/7]

void sese::text::AbstractStringBuffer::append ( const std::string & str)
virtualnoexcept

sese::text::StringBuffer 重载.

引用了 append().

◆ append() [5/7]

void sese::text::AbstractStringBuffer::append ( const std::string_view & str)
virtualnoexcept

sese::text::StringBuffer 重载.

引用了 append().

◆ append() [6/7]

void sese::text::AbstractStringBuffer::append ( const String & str)
virtualnoexcept

◆ append() [7/7]

void sese::text::AbstractStringBuffer::append ( const StringView & view)
virtualnoexcept

sese::text::StringBuffer 重载.

引用了 append().

◆ buf()

void * sese::text::AbstractStringBuffer::buf ( )
virtual

引用了 buffer.

◆ clear()

◆ del()

bool sese::text::AbstractStringBuffer::del ( int start,
int l )
virtual

sese::text::StringBuffer 重载.

引用了 buffer , 以及 len.

被这些函数引用 sese::text::StringBuffer::del().

◆ delCharAt()

bool sese::text::AbstractStringBuffer::delCharAt ( int index)
virtual

sese::text::StringBuffer 重载.

引用了 buffer, CheckRange , 以及 len.

被这些函数引用 sese::text::StringBuffer::delCharAt().

◆ empty()

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

◆ endsWith() [1/2]

bool sese::text::AbstractStringBuffer::endsWith ( const std::string_view & suffix) const
nodiscardvirtualnoexcept

◆ endsWith() [2/2]

bool sese::text::AbstractStringBuffer::endsWith ( const std::string_view & text,
const std::string_view & suffix )
staticnoexcept

被这些函数引用 sese::text::StringBuffer::endsWith().

◆ expansion()

void sese::text::AbstractStringBuffer::expansion ( size_t new_size)
protectednoexcept

字符串缓存

扩容

参数
new_size扩容后大小

被这些函数引用 insertAt().

◆ getCharAt()

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

sese::text::StringBuffer 重载.

引用了 buffer, cap , 以及 CheckRange.

被这些函数引用 sese::text::StringBuffer::getCharAt().

◆ insertAt() [1/6]

◆ insertAt() [2/6]

bool sese::text::AbstractStringBuffer::insertAt ( int index,
const char * str )
virtual

sese::text::StringBuffer 重载.

引用了 insertAt().

◆ insertAt() [3/6]

bool sese::text::AbstractStringBuffer::insertAt ( int index,
const std::string & str )
virtual

sese::text::StringBuffer 重载.

引用了 insertAt().

◆ insertAt() [4/6]

bool sese::text::AbstractStringBuffer::insertAt ( int index,
const std::string_view & str )
virtual

sese::text::StringBuffer 重载.

引用了 insertAt().

◆ insertAt() [5/6]

bool sese::text::AbstractStringBuffer::insertAt ( int index,
const String & str )
virtual

◆ insertAt() [6/6]

bool sese::text::AbstractStringBuffer::insertAt ( int index,
const StringView & view )
virtual

◆ length()

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

sese::text::StringBuffer 重载.

引用了 len.

被这些函数引用 sese::text::StringBuffer::length().

◆ reverse()

void sese::text::AbstractStringBuffer::reverse ( )
virtualnoexcept

sese::text::StringBuffer 重载.

引用了 buffer , 以及 len.

被这些函数引用 sese::text::StringBuffer::reverse().

◆ setChatAt()

bool sese::text::AbstractStringBuffer::setChatAt ( int index,
char ch )
virtual

sese::text::StringBuffer 重载.

引用了 buffer, cap , 以及 CheckRange.

被这些函数引用 sese::text::StringBuffer::setChatAt().

◆ size()

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

sese::text::StringBuffer 重载.

引用了 cap.

被这些函数引用 sese::text::StringBuffer::size().

◆ split() [1/2]

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

◆ split() [2/2]

◆ startsWith() [1/2]

bool sese::text::AbstractStringBuffer::startsWith ( const std::string_view & prefix) const
nodiscardvirtualnoexcept

◆ startsWith() [2/2]

bool sese::text::AbstractStringBuffer::startsWith ( const std::string_view & text,
const std::string_view & prefix )
staticnoexcept

◆ toSString()

String sese::text::AbstractStringBuffer::toSString ( )
virtual

sese::text::StringBuffer 重载.

引用了 buffer , 以及 len.

被这些函数引用 sese::text::StringBuffer::toSString().

◆ toString()

◆ trim()

void sese::text::AbstractStringBuffer::trim ( )
virtualnoexcept

去除两端空格

sese::text::StringBuffer 重载.

引用了 buffer, sese::isSpace() , 以及 len.

被这些函数引用 sese::text::StringBuffer::trim().

类成员变量说明

◆ buffer

char* sese::text::AbstractStringBuffer::buffer = nullptr
protected

◆ cap

size_t sese::text::AbstractStringBuffer::cap {}
protected

被这些函数引用 getCharAt(), insertAt(), setChatAt() , 以及 size().

◆ len

size_t sese::text::AbstractStringBuffer::len = 0
protected

实际容量

被这些函数引用 clear(), del(), delCharAt(), empty(), insertAt(), length(), reverse(), toSString(), toString() , 以及 trim().


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