Foxit PDF SDK
CFX_MapByteStringToPtr类 参考

继承自 CFX_Object .

struct  CAssoc
 CFX_MapByteStringToPtr中的关联。 更多...
 

Public 成员函数

 CFX_MapByteStringToPtr (int nBlockSize=10, IFX_Allocator *pAllocator=0)
 使用指定的块大小进行构造。 更多...
 
 ~CFX_MapByteStringToPtr ()
 析构函数。
 
int GetCount () const
 获取元素的数量。 更多...
 
FX_DWORD GetHashTableSize () const
 获取内部哈希表大小。派生类的高级功能。 更多...
 
void GetNextAssoc (FX_POSITION &rNextPosition, CFX_ByteString &rKey, void *&rValue) const
 获取当前关联并将位置设置为下一个关联。 更多...
 
FX_LPVOID GetNextValue (FX_POSITION &rNextPosition) const
 获取当前值并将位置设置为下一个关联。 更多...
 
FX_POSITION GetStartPosition () const
 获取第一个键值对位置。用于遍历所有(键, 值)对。 更多...
 
FX_DWORD HashKey (FX_BSTR key) const
 用于用户提供的哈希键的例程。 更多...
 
void InitHashTable (FX_DWORD hashSize, FX_BOOL bAllocNow=true)
 初始化哈希表。 更多...
 
FX_BOOL IsEmpty () const
 验证映射是否为空。 更多...
 
FX_BOOL Lookup (FX_BSTR key, void *&rValue) const
 通过键查找。 更多...
 
void *& operator[] (FX_BSTR key)
 下标([])运算符重载。查找,如果不存在则添加。 更多...
 
void RemoveAll ()
 移除映射中的所有(键, 值)对。 更多...
 
FX_BOOL RemoveKey (FX_BSTR key)
 移除现有键。 更多...
 
void SetAt (FX_BSTR key, void *newValue)
 添加新的(键, 值)对。如果不存在则添加,否则修改。 更多...
 

详细描述

表示字节字符串映射的类。

构造及析构函数说明

◆ CFX_MapByteStringToPtr()

CFX_MapByteStringToPtr::CFX_MapByteStringToPtr ( int  nBlockSize = 10,
IFX_Allocator pAllocator = 0 
)

使用指定的块大小进行构造。

参数
[in]nBlockSize内部块。默认值:10。
[in]pAllocator此类中使用的分配器。NULL表示使用默认分配器。 默认值:NULL

成员函数说明

◆ GetCount()

int CFX_MapByteStringToPtr::GetCount ( ) const
inline

获取元素的数量。

返回
映射中元素的数量。

◆ GetHashTableSize()

FX_DWORD CFX_MapByteStringToPtr::GetHashTableSize ( ) const
inline

获取内部哈希表大小。派生类的高级功能。

返回
哈希表大小。

◆ GetNextAssoc()

void CFX_MapByteStringToPtr::GetNextAssoc ( FX_POSITION rNextPosition,
CFX_ByteString rKey,
void *&  rValue 
) const

获取当前关联并将位置设置为下一个关联。

参数
[in,out]rNextPosition输入一个位置,并接收下一个关联位置作为结果。
[out]rKey接收键。
[out]rValue接收值。
返回
无。

◆ GetNextValue()

FX_LPVOID CFX_MapByteStringToPtr::GetNextValue ( FX_POSITION rNextPosition) const

获取当前值并将位置设置为下一个关联。

参数
[in,out]rNextPosition输入一个位置,并接收下一个关联位置作为结果。
返回
当前值。

◆ GetStartPosition()

FX_POSITION CFX_MapByteStringToPtr::GetStartPosition ( ) const
inline

获取第一个键值对位置。用于遍历所有(键, 值)对。

返回
映射中第一个键值对的位置。

◆ HashKey()

FX_DWORD CFX_MapByteStringToPtr::HashKey ( FX_BSTR  key) const

用于用户提供的哈希键的例程。

可重写:特殊非虚拟(有关详细信息,请参阅映射实现)。

参数
[in]key用于生成哈希键的键。
返回
哈希值。

◆ InitHashTable()

void CFX_MapByteStringToPtr::InitHashTable ( FX_DWORD  hashSize,
FX_BOOL  bAllocNow = true 
)

初始化哈希表。

参数
[in]hashSize初始化哈希表大小。
[in]bAllocNow决定是否立即分配哈希表的布尔值。 true表示立即分配哈希表,false表示不分配。
返回
无。

◆ IsEmpty()

FX_BOOL CFX_MapByteStringToPtr::IsEmpty ( ) const
inline

验证映射是否为空。

返回
true表示当前映射为空,false表示当前映射不为空。

◆ Lookup()

FX_BOOL CFX_MapByteStringToPtr::Lookup ( FX_BSTR  key,
void *&  rValue 
) const

通过键查找。

参数
[in]key要查找的键。
[out]rValue接收找到值的无类型指针的引用。
返回
true表示找到键,false表示未找到键。

◆ operator[]()

void*& CFX_MapByteStringToPtr::operator[] ( FX_BSTR  key)

下标([])运算符重载。查找,如果不存在则添加。

参数
[in]key要查找的键。
返回
找到值的引用。

◆ RemoveAll()

void CFX_MapByteStringToPtr::RemoveAll ( )

移除映射中的所有(键, 值)对。

返回
无。

◆ RemoveKey()

FX_BOOL CFX_MapByteStringToPtr::RemoveKey ( FX_BSTR  key)

移除现有键。

参数
[in]key要移除的键。
返回
true表示移除成功,false表示键不存在。

◆ SetAt()

void CFX_MapByteStringToPtr::SetAt ( FX_BSTR  key,
void *  newValue 
)
inline

添加新的(键, 值)对。如果不存在则添加,否则修改。

参数
[in]key指定位置的键。
[in]newValue新值。
返回
无。