本文整理汇总了C++中UtlHashMap::find方法的典型用法代码示例。如果您正苦于以下问题:C++ UtlHashMap::find方法的具体用法?C++ UtlHashMap::find怎么用?C++ UtlHashMap::find使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类UtlHashMap
的用法示例。
在下文中一共展示了UtlHashMap::find方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: getContent
UtlBoolean SipPublishContentMgr::getContent(const char* resourceId,
const char* eventTypeKey,
const char* acceptHeaderValue,
HttpBody*& content,
UtlBoolean& isDefaultContent)
{
#ifdef TEST_PRINT
osPrintf("SipPublishContentMgr::getContent(%s, %s, %s, ...)\n",
resourceId, eventTypeKey, acceptHeaderValue);
#endif
UtlBoolean foundContent = FALSE;
UtlString key(resourceId);
key.append(eventTypeKey);
PublishContentContainer* container = NULL;
UtlHashMap contentTypes;
isDefaultContent = FALSE;
UtlBoolean acceptedTypesGiven = buildContentTypesContainer(acceptHeaderValue, contentTypes);
lock();
// See if resource specific content exists
container =
(PublishContentContainer*) mContentEntries.find(&key);
// No resource specific content check if the default exists
if(container == NULL)
{
key = eventTypeKey;
container =
(PublishContentContainer*) mDefaultContentEntries.find(&key);
if(container)
{
isDefaultContent = TRUE;
}
}
if(container)
{
HttpBody* bodyPtr = NULL;
UtlSListIterator contentIterator(container->mEventContent);
while((bodyPtr = (HttpBody*)contentIterator()))
{
// No MIME types specified, take the first one
if(!acceptedTypesGiven)
{
content = HttpBody::copyBody(*bodyPtr);
foundContent = TRUE;
break;
}
// Find the first match. The container has the bodies
// in the servers preferred order.
if(contentTypes.find(bodyPtr))
{
content = HttpBody::copyBody(*bodyPtr);
foundContent = TRUE;
break;
}
}
}
else
{
OsSysLog::add(FAC_SIP, PRI_WARNING,
"SipPublishContentMgr::getContent no container is found\n");
}
unlock();
contentTypes.destroyAll();
return(foundContent);
}