概览
示例
截图
比较
应用
下载
Documentation
集市
现状与日程
常见问题
作者与许可证
论坛
资助Ultimate++
搜索本站
语言
中文(简体)













SourceForge.net Logo



本页面还未被翻译. 你要帮助翻译吗?

 

StringBuffer

 

class StringBuffer : private NoCopy

A class useful when working with code that expects a character buffer, like C code. It supports constant time pick assignment to and from String.

 

 

Constructor Detail

 

StringBuffer()

Constructs empty buffer.

 


 

StringBuffer(int len)

Constructs buffer of len characters.

 


 

StringBuffer(String& s)

Assigns content of s to StringBuffer. Clears s.

 


 

~StringBuffer()

Default destructor.

 

 

Public Method List

 

char *Begin()

Returns a pointer to the buffer of characters. Mutating operations invalidate this pointer.

 


 

char *End()

Returns Begin() + GetCount(). Mutating operations invalidate this pointer.

 


 

void Cat(int c)

Appends single character c.

 


 

void Cat(int c, int count)

Appends count characters c.

 


 

void Cat(const char *s)

void Cat(const String& s)

Appends the string s.

 


 

void Cat(const char *s, int l)

Appends the first l characters of s.

 


 

int GetLength() const

int GetCount() const

Returns the number of characters in the buffer.

 


 

void SetLength(int l)

void SetCount(int l)

Sets the length of the character buffer to l.

 


 

void Strlen()

Sets the length of the character buffer to the length of the zero terminated string stored in the buffer (up to the first zero character). Useful for converting C strings returned from system to String.

 


 

void Clear()

Clears the contents of the string buffer.

 


 

void Reserve(int r)

Preallocates internal buffer (avoids resizing of internal buffer up to r characters).

 


 

int GetAlloc() const

Returns the maximum number of characters in the internal buffer.

 


 

operator char*()

char *operator~()

Returns Begin().

 


 

void operator=(String& s)

Clears the string buffer and assigns the content of s. Clears s.

 

 

 

 

WStringBuffer

 

class WStringBuffer : private NoCopy

A class useful when working with code that expects a wide character buffer, like C code. It supports constant time pick assignment to and from WString.

 

 

Constructor Detail

 

WStringBuffer()

Constructs empty buffer.

 


 

WStringBuffer(int len)

Constructs buffer of len characters.

 


 

WStringBuffer(WString& s)

Assigns content of s to StringBuffer. Clears s.

 


 

~WStringBuffer()

Default destructor.

 

 

Public Method List

 

wchar *Begin()

Returns a pointer to the buffer of characters. Mutating operations invalidate this pointer.

 


 

wchar *End()

Returns Begin() + GetCount(). Mutating operations invalidate this pointer.

 


 

void Cat(int c)

Appends single character c.

 


 

void Cat(int c, int count)

Appends count characters c.

 


 

void Cat(const wchar *s)

void Cat(const WString& s)

void Cat(const char *s)

Appends the string s.

 


 

void Cat(const wchar *s, int l)

Appends the first l characters of s.

 


 

int GetLength() const

int GetCount() const

Returns the number of characters in the buffer.

 


 

void SetLength(int l)

void SetCount(int l)

Sets the length of the character buffer to l.

 


 

void Strlen()

Sets the length of the character buffer to the length of the zero terminated string stored in the buffer (up to the first zero character). Useful for converting C strings returned from system to String.

 


 

void Clear()

Clears the contents of the string buffer.

 


 

void Reserve(int r)

Preallocates internal buffer (avoids resizing of internal buffer up to r characters).

 


 

int GetAlloc() const

Returns the maximum number of characters in the internal buffer.

 


 

operator wchar*()

wchar *operator~()

Returns Begin().

 


 

void operator=(WString& s)

Clears the string buffer and assigns the content of s. Clears s.

 

 

本页也有english版本. 你想帮忙吗?