Foxit PDF SDK
CFX_ByteStringC类 参考

常量字节字符串类 更多...

继承自 CFX_Object .

被 CFX_ByteStringL 继承.

Public 成员函数

 CFX_ByteStringC ()
 构造一个空的常量字符串。
 
 CFX_ByteStringC (FX_LPCBYTE ptr, FX_STRSIZE size)
 从字节字符串构造。 更多...
 
 CFX_ByteStringC (FX_LPCSTR ptr)
 从字符字符串构造。 更多...
 
 CFX_ByteStringC (const FX_CHAR &ch)
 从单个字符构造。 更多...
 
 CFX_ByteStringC (FX_LPCSTR ptr, FX_STRSIZE len)
 从字符字符串构造。 更多...
 
 CFX_ByteStringC (const CFX_ByteStringC &src)
 复制构造函数 更多...
 
 CFX_ByteStringC (const CFX_ByteString &src)
 从字节字符串构造。 更多...
 
FX_BYTE GetAt (FX_STRSIZE index) const
 此方法检索由索引号指定的单个字节。 更多...
 
FX_LPCSTR GetCStr () const
 获取指向字节字符串的常量字符字符串指针。 更多...
 
FX_DWORD GetID (FX_STRSIZE start_pos=0) const
 从特定位置获取字符串的DWORD标识符。 更多...
 
FX_STRSIZE GetLength () const
 获取字节字符串的长度。 更多...
 
FX_LPCBYTE GetPtr () const
 获取指向字节字符串的常量字节字符串指针。 更多...
 
bool IsEmpty () const
 检查当前字符串对象是否为空。 更多...
 
CFX_ByteStringC Mid (FX_STRSIZE index, FX_STRSIZE count=-1) const
 此方法从此CFX_ByteStringC对象中提取长度为count字节的子字符串, 从位置index(基于零)开始。 更多...
 
bool operator != (const CFX_ByteStringC &str) const
 比较(!=)运算符重载。区分大小写。 更多...
 
 operator FX_LPCBYTE () const
 此转换运算符访问CFX_ByteStringC对象中引用的字节字符串。 更多...
 
CFX_ByteStringCoperator= (FX_LPCSTR src)
 赋值(=)运算符重载。来自字符字符串。 更多...
 
CFX_ByteStringCoperator= (const CFX_ByteStringC &src)
 赋值(=)运算符重载。来自CFX_ByteStringC对象。 更多...
 
CFX_ByteStringCoperator= (const CFX_ByteString &src)
 赋值(=)运算符重载。来自CFX_ByteString对象。 更多...
 
bool operator== (const CFX_ByteStringC &str) const
 比较(==)运算符重载。区分大小写。 更多...
 

详细描述

常量字节字符串类

常量字节字符串,它不包含缓冲区,因此其内容不能直接更改。

构造及析构函数说明

◆ CFX_ByteStringC() [1/5]

CFX_ByteStringC::CFX_ByteStringC ( FX_LPCBYTE  ptr,
FX_STRSIZE  size 
)
inline

从字节字符串构造。

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

◆ CFX_ByteStringC() [2/5]

CFX_ByteStringC::CFX_ByteStringC ( FX_LPCSTR  ptr)
inline

从字符字符串构造。

参数
[in]ptr指向常量字符字符串的指针,字符串必须以null结尾。

◆ CFX_ByteStringC() [3/5]

CFX_ByteStringC::CFX_ByteStringC ( const FX_CHAR ch)
inlineexplicit

从单个字符构造。

参数
[in]ch单个字符。

◆ CFX_ByteStringC() [4/5]

CFX_ByteStringC::CFX_ByteStringC ( FX_LPCSTR  ptr,
FX_STRSIZE  len 
)
inline

从字符字符串构造。

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

◆ CFX_ByteStringC() [5/5]

CFX_ByteStringC::CFX_ByteStringC ( const CFX_ByteStringC src)
inline

复制构造函数

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

成员函数说明

◆ GetAt()

FX_BYTE CFX_ByteStringC::GetAt ( FX_STRSIZE  index) const
inline

此方法检索由索引号指定的单个字节。

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

◆ GetCStr()

FX_LPCSTR CFX_ByteStringC::GetCStr ( ) const
inline

获取指向字节字符串的常量字符字符串指针。

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

◆ GetID()

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

从特定位置获取字符串的DWORD标识符。

此DWORD可用于快速比较。使用MSB优先方案。如果字符串没有 足够的字节,则缺失的字节将使用零。

参数
[in]start_pos常量字节字符串中的起始位置。
返回
DWORD标识符。
注解
例如:
CFX_ByteString str1("hello"), str2("hey");
FX_BOOL bCheck1 = str1.GetID() == FXBSTR_ID('h', 'e', 'l', 'l'); // 返回TRUE
FX_BOOL bCheck2 = str2.GetID() == FXBSTR_ID('h', 'e', 'y', 0); // 返回TRUE

◆ GetLength()

FX_STRSIZE CFX_ByteStringC::GetLength ( ) const
inline

获取字节字符串的长度。

返回
字节字符串的长度。

◆ GetPtr()

FX_LPCBYTE CFX_ByteStringC::GetPtr ( ) const
inline

获取指向字节字符串的常量字节字符串指针。

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

◆ IsEmpty()

bool CFX_ByteStringC::IsEmpty ( ) const
inline

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

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

◆ Mid()

CFX_ByteStringC CFX_ByteStringC::Mid ( FX_STRSIZE  index,
FX_STRSIZE  count = -1 
) const
inline

此方法从此CFX_ByteStringC对象中提取长度为count字节的子字符串, 从位置index(基于零)开始。

参数
[in]index指定CFX_ByteStringC对象中基于零的索引。
[in]count指定要从此CFX_ByteStringC对象中提取的字节数。
返回
引用子字符串的CFX_ByteStringC对象。

◆ operator !=()

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

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

参数
[in]strCFX_ByteStringC对象的常量引用。
返回
true表示不相等,false表示相等。

◆ operator FX_LPCBYTE()

CFX_ByteStringC::operator FX_LPCBYTE ( ) const
inline

此转换运算符访问CFX_ByteStringC对象中引用的字节字符串。

返回
指向字符串中数据的字节字符串指针。
注解
CFX_ByteStringC不能隐式转换为FX_LPCSTR指针, 因为很可能CFX_ByteStringC缓冲区不是以null结尾的。

◆ operator=() [1/2]

CFX_ByteStringC& CFX_ByteStringC::operator= ( FX_LPCSTR  src)
inline

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

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

◆ operator=() [2/2]

CFX_ByteStringC& CFX_ByteStringC::operator= ( const CFX_ByteStringC src)
inline

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

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

◆ operator==()

bool CFX_ByteStringC::operator== ( const CFX_ByteStringC str) const
inline

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

参数
[in]strCFX_ByteStringC对象的常量引用。
返回
true表示相等,false表示不相等。