本文整理汇总了C++中CFX_ByteStringC::GetPtr方法的典型用法代码示例。如果您正苦于以下问题:C++ CFX_ByteStringC::GetPtr方法的具体用法?C++ CFX_ByteStringC::GetPtr怎么用?C++ CFX_ByteStringC::GetPtr使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CFX_ByteStringC
的用法示例。
在下文中一共展示了CFX_ByteStringC::GetPtr方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: SetAt
void CFX_CMapByteStringToPtr::SetAt(const CFX_ByteStringC& key, void* value) {
ASSERT(value != NULL);
int index, key_len = key.GetLength();
int size = m_Buffer.GetSize();
for (index = 0; index < size; index++) {
_CompactString* pKey = (_CompactString*)m_Buffer.GetAt(index);
if (!_CompactStringSame(pKey, key.GetPtr(), key_len)) {
continue;
}
*(void**)(pKey + 1) = value;
return;
}
for (index = 0; index < size; index++) {
_CompactString* pKey = (_CompactString*)m_Buffer.GetAt(index);
if (pKey->m_CompactLen) {
continue;
}
_CompactStringStore(pKey, key.GetPtr(), key_len);
*(void**)(pKey + 1) = value;
return;
}
_CompactString* pKey = (_CompactString*)m_Buffer.Add();
_CompactStringStore(pKey, key.GetPtr(), key_len);
*(void**)(pKey + 1) = value;
}
示例2: FXJSE_DynPropGetterAdapter
static void FXJSE_DynPropGetterAdapter(const FXJSE_CLASS* lpClass,
FXJSE_HOBJECT hObject,
const CFX_ByteStringC& szPropName,
FXJSE_HVALUE hValue) {
ASSERT(lpClass);
int32_t nPropType =
lpClass->dynPropTypeGetter == nullptr
? FXJSE_ClassPropType_Property
: lpClass->dynPropTypeGetter(hObject, szPropName, FALSE);
if (nPropType == FXJSE_ClassPropType_Property) {
if (lpClass->dynPropGetter) {
lpClass->dynPropGetter(hObject, szPropName, hValue);
}
} else if (nPropType == FXJSE_ClassPropType_Method) {
if (lpClass->dynMethodCall && hValue) {
CFXJSE_Value* lpValue = reinterpret_cast<CFXJSE_Value*>(hValue);
v8::Isolate* pIsolate = lpValue->GetIsolate();
v8::HandleScope hscope(pIsolate);
v8::Local<v8::ObjectTemplate> hCallBackInfoTemplate =
v8::ObjectTemplate::New();
hCallBackInfoTemplate->SetInternalFieldCount(2);
v8::Local<v8::Object> hCallBackInfo =
hCallBackInfoTemplate->NewInstance();
hCallBackInfo->SetAlignedPointerInInternalField(
0, const_cast<FXJSE_CLASS*>(lpClass));
hCallBackInfo->SetInternalField(
1, v8::String::NewFromUtf8(
pIsolate, reinterpret_cast<const char*>(szPropName.GetPtr()),
v8::String::kNormalString, szPropName.GetLength()));
lpValue->ForceSetValue(v8::Function::New(
lpValue->GetIsolate(), FXJSE_DynPropGetterAdapter_MethodCallback,
hCallBackInfo));
}
}
}
示例3: AddValue
void CFX_CMapByteStringToPtr::AddValue(const CFX_ByteStringC& key,
void* value) {
ASSERT(value != NULL);
_CompactString* pKey = (_CompactString*)m_Buffer.Add();
_CompactStringStore(pKey, key.GetPtr(), key.GetLength());
*(void**)(pKey + 1) = value;
}
示例4: RemoveKey
void CFX_CMapByteStringToPtr::RemoveKey(const CFX_ByteStringC& key) {
int key_len = key.GetLength();
int size = m_Buffer.GetSize();
for (int index = 0; index < size; index++) {
_CompactString* pKey = (_CompactString*)m_Buffer.GetAt(index);
if (!_CompactStringSame(pKey, key.GetPtr(), key_len)) {
continue;
}
_CompactStringRelease(pKey);
pKey->m_CompactLen = 0xfe;
return;
}
}
示例5: SearchToken
FX_BOOL CPDF_SimpleParser::SearchToken(const CFX_ByteStringC& token) {
int token_len = token.GetLength();
while (m_dwCurPos < m_dwSize - token_len) {
if (FXSYS_memcmp(m_pData + m_dwCurPos, token.GetPtr(), token_len) == 0) {
break;
}
m_dwCurPos++;
}
if (m_dwCurPos == m_dwSize - token_len) {
return FALSE;
}
m_dwCurPos += token_len;
return TRUE;
}
示例6: CopyData
void CFX_ByteTextBuf::operator=(const CFX_ByteStringC& str) {
CopyData(str.GetPtr(), str.GetLength());
}
示例7:
CPDF_SimpleParser::CPDF_SimpleParser(const CFX_ByteStringC& str) {
m_pData = str.GetPtr();
m_dwSize = str.GetLength();
m_dwCurPos = 0;
}