Foxit PDF SDK
CFX_ByteString类 参考

字节字符串类 更多...

继承自 CFX_Object .

Public 成员函数

 CFX_ByteString ()
 构造一个空的字节字符串。
 
 CFX_ByteString (const CFX_ByteString &str)
 复制构造函数。 更多...
 
 CFX_ByteString (char ch)
 从单个字符构造。 更多...
 
 CFX_ByteString (FX_LPCSTR ptr, FX_STRSIZE len=-1)
 从字符字符串构造。 更多...
 
 CFX_ByteString (FX_LPCBYTE ptr, FX_STRSIZE len)
 从字节字符串构造。 更多...
 
 CFX_ByteString (FX_BSTR bstrc)
 从CFX_ByteStringC对象的常量引用构造。 更多...
 
 CFX_ByteString (FX_BSTR bstrc1, FX_BSTR bstrc2)
 连接构造函数。 更多...
 
 ~CFX_ByteString ()
 
int Compare (FX_BSTR str) const
 将字符串与另一个字符串进行比较。区分大小写。 更多...
 
void ConvertFrom (const CFX_WideString &str, CFX_CharMap *pCharMap=NULL)
 使用指定的字符映射器将unicode数据加载到此字节字符串中。 如果未指定字符映射器,将使用系统默认映射器。 更多...
 
FX_STRSIZE Delete (FX_STRSIZE index, FX_STRSIZE count=1)
 从指定位置开始删除一个或多个字符。 更多...
 
void Empty ()
 将此字符串设置为空。 更多...
 
bool Equal (FX_BSTR str) const
 检查当前字符串是否等于另一个字符串。区分大小写。 更多...
 
bool EqualNoCase (FX_BSTR str) const
 检查当前字符串是否等于另一个字符串,不考虑大小写。 更多...
 
FX_STRSIZE Find (FX_BSTR lpszSub, FX_STRSIZE start=0) const
 从指定位置查找子字符串。仅找到第一次出现的位置。 更多...
 
FX_STRSIZE Find (FX_CHAR ch, FX_STRSIZE start=0) const
 从指定位置查找字符。仅找到第一次出现的位置。 更多...
 
void Format (FX_LPCSTR lpszFormat,...)
 将一些参数格式化到此字节字符串中。 更多...
 
void FormatV (FX_LPCSTR lpszFormat, va_list argList)
 使用va_list将一些参数格式化到此字节字符串中。 更多...
 
FX_BYTE GetAt (FX_STRSIZE nIndex) const
 获取由索引号指定的单个字节。 更多...
 
FX_LPSTR GetBuffer (FX_STRSIZE len)
 获取分配了指定字节数的缓冲区。 更多...
 
FX_DWORD GetID (FX_STRSIZE start_pos=0) const
 获取字符串的DWORD标识符。有关详细信息,请参阅函数CFX_ByteStringC::GetID更多...
 
FX_STRSIZE GetLength () const
 获取字节字符串中的字节数(不计算任何可能的终止符)。 更多...
 
FX_STRSIZE Insert (FX_STRSIZE index, FX_CHAR ch)
 在指定位置之前插入字符。 更多...
 
bool IsEmpty () const
 检查当前字符串对象是否为空。 更多...
 
CFX_ByteString Left (FX_STRSIZE count) const
 从此CFX_ByteString对象中提取第一个(最左边)count个字节作为子字符串。 更多...
 
void Load (FX_LPCBYTE str, FX_STRSIZE len)
 从字节字符串加载。 更多...
 
FX_LPSTR LockBuffer ()
 锁定并获取当前字符串缓冲区,以便调用者可以修改返回的缓冲区。 更多...
 
void MakeLower ()
 将英文字母的大小写更改为小写。 更多...
 
void MakeUpper ()
 将英文字母的大小写更改为大写。 更多...
 
CFX_ByteString Mid (FX_STRSIZE first) const
 从此CFX_ByteString对象中提取子字符串,从位置nFirst(基于零)开始到最后。 更多...
 
CFX_ByteString Mid (FX_STRSIZE first, FX_STRSIZE count) const
 从此CFX_ByteString对象中提取count个字节的子字符串,从位置nFirst(基于零)开始到最后。 更多...
 
bool operator != (FX_LPCSTR str) const
 比较(!=)运算符重载。区分大小写。 更多...
 
bool operator != (FX_BSTR str) const
 比较(!=)运算符重载。区分大小写。 更多...
 
bool operator != (const CFX_ByteString &str) const
 比较(!=)运算符重载。区分大小写。 更多...
 
 operator FX_LPCBYTE () const
 FX_LPCBYTE类型转换操作符。CFX_ByteString可以在需要FX_LPCSTR或FX_LPCBYTE的地方使用。
 
 operator FX_LPCSTR () const
 FX_LPCSTR类型转换操作符。CFX_ByteString可以在需要FX_LPCSTR或FX_LPCBYTE的地方使用。
 
const CFX_ByteStringoperator+= (FX_CHAR ch)
 连接(+=)运算符重载。连接单个字符。 更多...
 
const CFX_ByteStringoperator+= (FX_LPCSTR str)
 连接(+=)运算符重载。连接以空字符结尾的字符串。 更多...
 
const CFX_ByteStringoperator+= (const CFX_ByteString &str)
 连接(+=)运算符重载。连接CFX_ByteString对象。 更多...
 
const CFX_ByteStringoperator+= (FX_BSTR bstrc)
 连接(+=)运算符重载。连接常量CFX_ByteStringC对象。 更多...
 
bool operator< (const CFX_ByteString &rhs) const
 比较(<)运算符重载。区分大小写。 更多...
 
const CFX_ByteStringoperator= (FX_LPCSTR str)
 赋值(=)运算符重载。来自字符字符串。 更多...
 
const CFX_ByteStringoperator= (FX_BSTR bstrc)
 赋值(=)运算符重载。来自常量字节字符串。 更多...
 
const CFX_ByteStringoperator= (const CFX_ByteString &stringSrc)
 赋值(=)运算符重载。来自CFX_ByteString对象。 更多...
 
const CFX_ByteStringoperator= (const CFX_BinaryBuf &buf)
 赋值(=)运算符重载。来自CFX_BinaryBuf对象。 更多...
 
bool operator== (FX_LPCSTR str) const
 比较(==)运算符重载。区分大小写。 更多...
 
bool operator== (FX_BSTR str) const
 比较(==)运算符重载。区分大小写。 更多...
 
bool operator== (const CFX_ByteString &str) const
 比较(==)运算符重载。区分大小写。 更多...
 
FX_BYTE operator[] (FX_STRSIZE nIndex) const
 下标([])运算符重载。它检索由nIndex中基于零的索引指定的单个字节。 更多...
 
void ReleaseBuffer (FX_STRSIZE len=-1)
 释放由函数CFX_ByteString::GetBufferCFX_ByteString::LockBuffer获取的缓冲区,并设置修改后字符串的长度。 更多...
 
FX_STRSIZE Remove (FX_CHAR ch)
 删除特定字符的所有出现。 更多...
 
FX_STRSIZE Replace (FX_BSTR lpszOld, FX_BSTR lpszNew)
 将字符串中的所有模式替换为新的子字符串。 更多...
 
void Reserve (FX_STRSIZE len)
 保留可以容纳指定字节数的缓冲区。 更多...
 
FX_STRSIZE ReverseFind (FX_CHAR ch) const
 从字符串末尾查找字符 更多...
 
CFX_ByteString Right (FX_STRSIZE count) const
 从此CFX_ByteString对象中提取最后(最右边)count个字节作为子字符串。 更多...
 
void SetAt (FX_STRSIZE nIndex, FX_CHAR ch)
 覆盖由索引号指定的单个字节。 更多...
 
void TrimLeft ()
 从字节字符串的左侧修剪空白字符。 更多...
 
void TrimLeft (FX_CHAR chTarget)
 从字节字符串左侧修剪指定字符的连续出现。 更多...
 
void TrimLeft (FX_BSTR lpszTargets)
 从字节字符串左侧修剪指定字符的连续出现。 更多...
 
void TrimRight ()
 从字节字符串的右侧修剪空白字符。 更多...
 
void TrimRight (FX_CHAR chTarget)
 从字节字符串右侧修剪指定字符的连续出现。 更多...
 
void TrimRight (FX_BSTR lpszTargets)
 从字节字符串右侧修剪指定字符的连续出现。 更多...
 
CFX_WideString UTF8Decode () const
 解码UTF-8 unicode字符串(假设此字节字符串是UTF-8编码的)。 更多...
 

静态 Public 成员函数

static CFX_ByteString FormatFloat (FX_FLOAT f, int precision=0)
 从浮点数转换。 更多...
 
static CFX_ByteString FormatInteger (FX_INT32 i, FX_DWORD flags=0)
 从整数转换。 更多...
 
static CFX_ByteString FormatInteger64 (FX_INT64 i)
 从Integer64转换。 更多...
 
static CFX_ByteString FromUnicode (FX_LPCWSTR ptr, FX_STRSIZE len=-1)
 从Unicode字符串创建CFX_ByteString对象。从Unicode转换为系统多字节字符集。 更多...
 
static CFX_ByteString FromUnicode (const CFX_WideString &str)
 从CFX_WideString对象创建CFX_ByteString对象。 更多...
 
static CFX_ByteString LoadFromFile (FX_BSTR file_path)
 加载文件的全部内容。 更多...
 

详细描述

字节字符串类

构造及析构函数说明

◆ CFX_ByteString() [1/6]

CFX_ByteString::CFX_ByteString ( const CFX_ByteString str)

复制构造函数。

参数
[in]strCFX_ByteString对象的常量引用。

◆ CFX_ByteString() [2/6]

CFX_ByteString::CFX_ByteString ( char  ch)
explicit

从单个字符构造。

参数
[in]ch单个字符。

◆ CFX_ByteString() [3/6]

CFX_ByteString::CFX_ByteString ( FX_LPCSTR  ptr,
FX_STRSIZE  len = -1 
)

从字符字符串构造。

参数
[in]ptr指向常量字符字符串的指针。
[in]len字符字符串的长度。len对于以零结尾的字符串可以为-1。

◆ CFX_ByteString() [4/6]

CFX_ByteString::CFX_ByteString ( FX_LPCBYTE  ptr,
FX_STRSIZE  len 
)

从字节字符串构造。

参数
[in]ptr指向常量字节字符串的指针。
[in]len字节字符串的长度。

◆ CFX_ByteString() [5/6]

CFX_ByteString::CFX_ByteString ( FX_BSTR  bstrc)

从CFX_ByteStringC对象的常量引用构造。

参数
[in]bstrcCFX_ByteStringC对象的常量引用。

◆ CFX_ByteString() [6/6]

CFX_ByteString::CFX_ByteString ( FX_BSTR  bstrc1,
FX_BSTR  bstrc2 
)

连接构造函数。

参数
[in]bstrc1第一个CFX_ByteStringC对象的常量引用。
[in]bstrc2第二个CFX_ByteStringC对象的常量引用。

◆ ~CFX_ByteString()

CFX_ByteString::~CFX_ByteString ( )

析构函数。

成员函数说明

◆ Compare()

int CFX_ByteString::Compare ( FX_BSTR  str) const

将字符串与另一个字符串进行比较。区分大小写。

参数
[in]str要比较的字节字符串。
返回
  • -1表示当前字符串在字母顺序上"小于"另一个字符串。
  • 0表示相等。
  • 1表示当前字符串在字母顺序上"大于"另一个字符串。

◆ ConvertFrom()

void CFX_ByteString::ConvertFrom ( const CFX_WideString str,
CFX_CharMap pCharMap = NULL 
)

使用指定的字符映射器将unicode数据加载到此字节字符串中。 如果未指定字符映射器,将使用系统默认映射器。

参数
[in]str输入的unicode字符串。
[in]pCharMap指定用于转换的字符映射器。
返回
无。

◆ Delete()

FX_STRSIZE CFX_ByteString::Delete ( FX_STRSIZE  index,
FX_STRSIZE  count = 1 
)

从指定位置开始删除一个或多个字符。

参数
[in]index指定字节字符串中开始删除的基于零的索引。
[in]count要删除的字节数。
返回
字节字符串的新长度。

◆ Empty()

void CFX_ByteString::Empty ( )

将此字符串设置为空。

返回
无。

◆ Equal()

bool CFX_ByteString::Equal ( FX_BSTR  str) const

检查当前字符串是否等于另一个字符串。区分大小写。

如果只需要检查两个字符串是否相等,此函数比函数CFX_ByteString::Compare更快。

参数
[in]str要比较的字节字符串。
返回
true表示当前字符串等于另一个字符串,false表示不等于。

◆ EqualNoCase()

bool CFX_ByteString::EqualNoCase ( FX_BSTR  str) const

检查当前字符串是否等于另一个字符串,不考虑大小写。

此函数将字母'A'-'Z'与'a'-'z'视为相同。

参数
[in]str要比较的字节字符串。
返回
true表示当前字符串等于另一个字符串,false表示不等于。

◆ Find() [1/2]

FX_STRSIZE CFX_ByteString::Find ( FX_BSTR  lpszSub,
FX_STRSIZE  start = 0 
) const

从指定位置查找子字符串。仅找到第一次出现的位置。

参数
[in]lpszSub要查找的子字符串。
[in]start指定进行查找的起始位置的基于零的索引。
返回值
找到第一次出现的位置。-1表示未找到。

◆ Find() [2/2]

FX_STRSIZE CFX_ByteString::Find ( FX_CHAR  ch,
FX_STRSIZE  start = 0 
) const

从指定位置查找字符。仅找到第一次出现的位置。

参数
[in]ch要查找的字符。
[in]start指定进行查找的起始位置的基于零的索引。
返回值
找到第一次出现的位置。-1表示未找到。

◆ Format()

void CFX_ByteString::Format ( FX_LPCSTR  lpszFormat,
  ... 
)

将一些参数格式化到此字节字符串中。

在桌面平台上,此函数支持所有sprintf()格式。
在嵌入式平台上,它仅支持格式的子集:

  • 支持的类型:d, u, f, g, x, X, s, c, 。
  • 支持宽度字段。
  • 不支持精度
  • 支持的标志:'0'。
参数
[in]lpszFormat指定格式控制字符串。
返回
无。

◆ FormatFloat()

static CFX_ByteString CFX_ByteString::FormatFloat ( FX_FLOAT  f,
int  precision = 0 
)
static

从浮点数转换。

参数
[in]f输入的浮点数。
[in]precision小数位数。默认值:0。
返回
CFX_ByteString对象。

◆ FormatInteger()

static CFX_ByteString CFX_ByteString::FormatInteger ( FX_INT32  i,
FX_DWORD  flags = 0 
)
static

从整数转换。

标志可以是以下标志(单个或复合):

  • FXFORMAT_SIGNED
  • FXFORMAT_HEX
  • FXFORMAT_CAPITAL
参数
[in]i输入的32位整数。
[in]flags格式化标志。默认值:0。
返回
CFX_ByteString对象。

◆ FormatInteger64()

static CFX_ByteString CFX_ByteString::FormatInteger64 ( FX_INT64  i)
static

从Integer64转换。

参数
[in]i输入的64位整数。
返回
CFX_ByteString对象。

◆ FormatV()

void CFX_ByteString::FormatV ( FX_LPCSTR  lpszFormat,
va_list  argList 
)

使用va_list将一些参数格式化到此字节字符串中。

参数
[in]lpszFormat指定格式控制字符串。
[in]argList可变参数列表。
返回
无。
参见
CFX_ByteString::Format

◆ FromUnicode() [1/2]

static CFX_ByteString CFX_ByteString::FromUnicode ( FX_LPCWSTR  ptr,
FX_STRSIZE  len = -1 
)
static

从Unicode字符串创建CFX_ByteString对象。从Unicode转换为系统多字节字符集。

参数
[in]ptr指向常量Unicode字符串的指针。
[in]lenUnicode字符串的长度。len对于以零结尾的Unicode字符串可以为-1。
返回
字节字符串。

◆ FromUnicode() [2/2]

static CFX_ByteString CFX_ByteString::FromUnicode ( const CFX_WideString str)
static

从CFX_WideString对象创建CFX_ByteString对象。

参数
[in]str常量CFX_WideString对象的引用。
返回
字节字符串。

◆ GetAt()

FX_BYTE CFX_ByteString::GetAt ( FX_STRSIZE  nIndex) const
inline

获取由索引号指定的单个字节。

参数
[in]nIndex指定字节字符串中基于零的索引。
返回
单个字节。

◆ GetBuffer()

FX_LPSTR CFX_ByteString::GetBuffer ( FX_STRSIZE  len)

获取分配了指定字节数的缓冲区。

此字符串的内容不会被函数CFX_ByteString::GetBuffer影响。 调用者可以修改返回的缓冲区,并应在修改完成后调用函数CFX_ByteString::ReleaseBuffer

参数
[in]len期望获取的长度。
返回
指向字节字符串的字符字符串指针。

◆ GetID()

FX_DWORD CFX_ByteString::GetID ( FX_STRSIZE  start_pos = 0) const

获取字符串的DWORD标识符。有关详细信息,请参阅函数CFX_ByteStringC::GetID

参数
[in]start_pos常量字节字符串中的起始位置。
返回
FX_DWORD标识符。

◆ GetLength()

FX_STRSIZE CFX_ByteString::GetLength ( ) const
inline

获取字节字符串中的字节数(不计算任何可能的终止符)。

返回
字节字符串的长度。

◆ Insert()

FX_STRSIZE CFX_ByteString::Insert ( FX_STRSIZE  index,
FX_CHAR  ch 
)

在指定位置之前插入字符。

参数
[in]index指定字节字符串中基于零的索引。
[in]ch单个字符。
返回
字节字符串的新长度。

◆ IsEmpty()

bool CFX_ByteString::IsEmpty ( ) const
inline

检查当前字符串对象是否为空。

返回
true表示当前字符串对象为空,false表示不为空。

◆ Left()

CFX_ByteString CFX_ByteString::Left ( FX_STRSIZE  count) const

从此CFX_ByteString对象中提取第一个(最左边)count个字节作为子字符串。

参数
[in]count期望为子字符串提取的字节数。
返回
CFX_ByteString子字符串。

◆ Load()

void CFX_ByteString::Load ( FX_LPCBYTE  str,
FX_STRSIZE  len 
)

从字节字符串加载。

参数
[in]str指向常量字节字符串的指针。
[in]len字节字符串的长度。
返回
无。

◆ LoadFromFile()

static CFX_ByteString CFX_ByteString::LoadFromFile ( FX_BSTR  file_path)
static

加载文件的全部内容。

参数
[in]file_path文件路径。
返回
CFX_ByteString对象。

◆ LockBuffer()

FX_LPSTR CFX_ByteString::LockBuffer ( )

锁定并获取当前字符串缓冲区,以便调用者可以修改返回的缓冲区。

调用者可以修改返回的缓冲区,并应在修改完成后调用函数CFX_ByteString::ReleaseBuffer

返回
指向字节字符串的字符字符串指针。

◆ MakeLower()

void CFX_ByteString::MakeLower ( )

将英文字母的大小写更改为小写。

返回
无。

◆ MakeUpper()

void CFX_ByteString::MakeUpper ( )

将英文字母的大小写更改为大写。

返回
无。

◆ Mid() [1/2]

CFX_ByteString CFX_ByteString::Mid ( FX_STRSIZE  first) const

从此CFX_ByteString对象中提取子字符串,从位置nFirst(基于零)开始到最后。

参数
[in]first指定此CFX_ByteString对象中起始位置的基于零的索引。
返回
CFX_ByteString子字符串。

◆ Mid() [2/2]

CFX_ByteString CFX_ByteString::Mid ( FX_STRSIZE  first,
FX_STRSIZE  count 
) const

从此CFX_ByteString对象中提取count个字节的子字符串,从位置nFirst(基于零)开始到最后。

参数
[in]first指定此CFX_ByteString对象中起始位置的基于零的索引。
[in]count期望为子字符串提取的字节数。
返回
CFX_ByteString子字符串。

◆ operator !=() [1/3]

bool CFX_ByteString::operator != ( FX_LPCSTR  str) const
inline

比较(!=)运算符重载。区分大小写。

参数
[in]str要比较的以null结尾的字符字符串。
返回
true表示不相等,false表示相等。

◆ operator !=() [2/3]

bool CFX_ByteString::operator != ( FX_BSTR  str) const
inline

比较(!=)运算符重载。区分大小写。

参数
[in]str要比较的以null结尾的常量字节字符串。
返回
true表示不相等,false表示相等。

◆ operator !=() [3/3]

bool CFX_ByteString::operator != ( const CFX_ByteString str) const
inline

比较(!=)运算符重载。区分大小写。

参数
[in]str要比较的以null结尾的字节字符串。
返回
true表示不相等,false表示相等。

◆ operator+=() [1/4]

const CFX_ByteString& CFX_ByteString::operator+= ( FX_CHAR  ch)

连接(+=)运算符重载。连接单个字符。

参数
[in]ch单个字符。
返回
当前对象本身的引用。

◆ operator+=() [2/4]

const CFX_ByteString& CFX_ByteString::operator+= ( FX_LPCSTR  str)

连接(+=)运算符重载。连接以空字符结尾的字符串。

参数
[in]str指向常量以空字符结尾的字符串的指针。
返回
当前对象本身的引用。

◆ operator+=() [3/4]

const CFX_ByteString& CFX_ByteString::operator+= ( const CFX_ByteString str)

连接(+=)运算符重载。连接CFX_ByteString对象。

参数
[in]str常量CFX_ByteString对象的引用。
返回
当前对象本身的引用。

◆ operator+=() [4/4]

const CFX_ByteString& CFX_ByteString::operator+= ( FX_BSTR  bstrc)

连接(+=)运算符重载。连接常量CFX_ByteStringC对象。

参数
[in]bstrc常量CFX_ByteStringC对象的引用。
返回
当前对象本身的引用。

◆ operator<()

bool CFX_ByteString::operator< ( const CFX_ByteString rhs) const

比较(<)运算符重载。区分大小写。

参数
[in]rhs右侧字符串。
返回
true表示当前字符串小于参数rhsfalse表示不小于。

◆ operator=() [1/4]

const CFX_ByteString& CFX_ByteString::operator= ( FX_LPCSTR  str)

赋值(=)运算符重载。来自字符字符串。

参数
[in]str指向常量字符字符串的指针。
返回
当前对象本身的引用。

◆ operator=() [2/4]

const CFX_ByteString& CFX_ByteString::operator= ( FX_BSTR  bstrc)

赋值(=)运算符重载。来自常量字节字符串。

参数
[in]bstrc常量字节字符串的引用。
返回
当前对象本身的引用。

◆ operator=() [3/4]

const CFX_ByteString& CFX_ByteString::operator= ( const CFX_ByteString stringSrc)

赋值(=)运算符重载。来自CFX_ByteString对象。

参数
[in]stringSrc常量CFX_ByteString对象的引用。
返回
当前对象本身的引用。

◆ operator=() [4/4]

const CFX_ByteString& CFX_ByteString::operator= ( const CFX_BinaryBuf buf)

赋值(=)运算符重载。来自CFX_BinaryBuf对象。

参数
[in]buf常量CFX_BinaryBuf对象的引用。
返回
当前对象本身的引用。

◆ operator==() [1/3]

bool CFX_ByteString::operator== ( FX_LPCSTR  str) const
inline

比较(==)运算符重载。区分大小写。

参数
[in]str要比较的以null结尾的字符字符串。
返回
true表示相等,false表示不相等。

◆ operator==() [2/3]

bool CFX_ByteString::operator== ( FX_BSTR  str) const
inline

比较(==)运算符重载。区分大小写。

参数
[in]str要比较的以null结尾的常量字节字符串。
返回
true表示相等,false表示不相等。

◆ operator==() [3/3]

bool CFX_ByteString::operator== ( const CFX_ByteString str) const

比较(==)运算符重载。区分大小写。

参数
[in]str要比较的以null结尾的字节字符串。
返回
true表示相等,false表示不相等。

◆ operator[]()

FX_BYTE CFX_ByteString::operator[] ( FX_STRSIZE  nIndex) const
inline

下标([])运算符重载。它检索由nIndex中基于零的索引指定的单个字节。

参数
[in]nIndex指定字节字符串中基于零的索引。
返回
单个字节。

◆ ReleaseBuffer()

void CFX_ByteString::ReleaseBuffer ( FX_STRSIZE  len = -1)

释放由函数CFX_ByteString::GetBufferCFX_ByteString::LockBuffer获取的缓冲区,并设置修改后字符串的长度。

如果参数len为-1,则假定它是以零结尾的字符串。

参数
[in]len期望释放到的长度。默认值:-1。
返回
无。

◆ Remove()

FX_STRSIZE CFX_ByteString::Remove ( FX_CHAR  ch)

删除特定字符的所有出现。

参数
[in]ch指定要删除的字符。
返回
删除的字符数。

◆ Replace()

FX_STRSIZE CFX_ByteString::Replace ( FX_BSTR  lpszOld,
FX_BSTR  lpszNew 
)

将字符串中的所有模式替换为新的子字符串。

参数
[in]lpszOld指定要在字节字符串中匹配和替换的字符串。
[in]lpszNew指定要替换的字符串。
返回
被替换的模式数量。

◆ Reserve()

void CFX_ByteString::Reserve ( FX_STRSIZE  len)

保留可以容纳指定字节数的缓冲区。

此字符串的内容不会改变。这可以在应用程序预期 字符串可能增长多次时使用,在这种情况下,保留更大的缓冲区将支持字符串增长 而无需缓冲区重新分配。

参数
[in]len期望保留的长度。
返回
无。

◆ ReverseFind()

FX_STRSIZE CFX_ByteString::ReverseFind ( FX_CHAR  ch) const

从字符串末尾查找字符

参数
[in]ch要在当前字符串中从末尾查找的字符。
返回
输入字符在当前字符串中的位置。-1表示未找到。

◆ Right()

CFX_ByteString CFX_ByteString::Right ( FX_STRSIZE  count) const

从此CFX_ByteString对象中提取最后(最右边)count个字节作为子字符串。

参数
[in]count期望为子字符串提取的字节数。
返回
CFX_ByteString子字符串。

◆ SetAt()

void CFX_ByteString::SetAt ( FX_STRSIZE  nIndex,
FX_CHAR  ch 
)

覆盖由索引号指定的单个字节。

参数
[in]nIndex指定字节字符串中基于零的索引。
[in]ch单个字符。
返回
无。

◆ TrimLeft() [1/3]

void CFX_ByteString::TrimLeft ( )

从字节字符串的左侧修剪空白字符。

返回
无。

◆ TrimLeft() [2/3]

void CFX_ByteString::TrimLeft ( FX_CHAR  chTarget)

从字节字符串左侧修剪指定字符的连续出现。

参数
[in]chTarget指定的字符。
返回
无。

◆ TrimLeft() [3/3]

void CFX_ByteString::TrimLeft ( FX_BSTR  lpszTargets)

从字节字符串左侧修剪指定字符的连续出现。

参数
[in]lpszTargets指定的字符。
返回
无。

◆ TrimRight() [1/3]

void CFX_ByteString::TrimRight ( )

从字节字符串的右侧修剪空白字符。

返回
无。

◆ TrimRight() [2/3]

void CFX_ByteString::TrimRight ( FX_CHAR  chTarget)

从字节字符串右侧修剪指定字符的连续出现。

参数
[in]chTarget指定的字符。
返回
无。

◆ TrimRight() [3/3]

void CFX_ByteString::TrimRight ( FX_BSTR  lpszTargets)

从字节字符串右侧修剪指定字符的连续出现。

参数
[in]lpszTargets指定的字符。
返回
无。

◆ UTF8Decode()

CFX_WideString CFX_ByteString::UTF8Decode ( ) const

解码UTF-8 unicode字符串(假设此字节字符串是UTF-8编码的)。

返回
unicode字符串。