Foxit PDF SDK
CFX_CMapByteStringToPtr类 参考

继承自 CFX_Object .

Public 成员函数

 CFX_CMapByteStringToPtr (IFX_Allocator *pAllocator=0)
 构造函数。 更多...
 
 ~CFX_CMapByteStringToPtr ()
 析构函数。
 
void AddValue (FX_BSTR key, void *pValue)
 向字典添加键值对,假定不存在重复键。 更多...
 
int GetCount () const
 获取键值对的数量。 更多...
 
void GetNextAssoc (FX_POSITION &rNextPosition, CFX_ByteString &rKey, void *&rValue) const
 获取当前关联并将位置设置为下一个关联。 更多...
 
FX_LPVOID GetNextValue (FX_POSITION &rNextPosition) const
 获取当前值并将位置设置为下一个关联。 更多...
 
FX_POSITION GetStartPosition () const
 获取第一个键值对位置。用于遍历所有(键, 值)对。 更多...
 
FX_BOOL Lookup (FX_BSTR key, void *&rValue) const
 通过键查找。 更多...
 
void RemoveAll ()
 移除映射中的所有键值对。 更多...
 
void RemoveKey (FX_BSTR key)
 移除现有的(键, ?)对。 更多...
 
void SetAt (FX_BSTR key, void *value)
 添加新的(键, 值)对。如果不存在则添加,否则修改。 更多...
 

详细描述

从字节字符串到指针的紧凑映射。
在以下情况下使用此类而不是CFX_MapByteStringToPtr:

  • 映射数量大多有限,例如几十个映射;
  • 映射键的长度大多有限,例如通常少于8个字符。

构造及析构函数说明

◆ CFX_CMapByteStringToPtr()

CFX_CMapByteStringToPtr::CFX_CMapByteStringToPtr ( IFX_Allocator pAllocator = 0)

构造函数。

参数
[in]pAllocator分配器。默认值:NULL

成员函数说明

◆ AddValue()

void CFX_CMapByteStringToPtr::AddValue ( FX_BSTR  key,
void *  pValue 
)

向字典添加键值对,假定不存在重复键。

这是快速构建整个字典的函数,但应谨慎使用。 如果发生重复键,只有第一个值将生效。

参数
[in]key要添加的键。
[in]pValue要添加的值。
返回
无。

◆ GetCount()

int CFX_CMapByteStringToPtr::GetCount ( ) const

获取键值对的数量。

返回
映射中键值对的数量。

◆ GetNextAssoc()

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

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

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

◆ GetNextValue()

FX_LPVOID CFX_CMapByteStringToPtr::GetNextValue ( FX_POSITION rNextPosition) const

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

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

◆ GetStartPosition()

FX_POSITION CFX_CMapByteStringToPtr::GetStartPosition ( ) const

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

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

◆ Lookup()

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

通过键查找。

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

◆ RemoveAll()

void CFX_CMapByteStringToPtr::RemoveAll ( )

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

返回
无。

◆ RemoveKey()

void CFX_CMapByteStringToPtr::RemoveKey ( FX_BSTR  key)

移除现有的(键, ?)对。

参数
[in]key要移除的键。
返回
无。

◆ SetAt()

void CFX_CMapByteStringToPtr::SetAt ( FX_BSTR  key,
void *  value 
)

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

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