本文整理汇总了C++中CookieMap::addSubdomainMap方法的典型用法代码示例。如果您正苦于以下问题:C++ CookieMap::addSubdomainMap方法的具体用法?C++ CookieMap::addSubdomainMap怎么用?C++ CookieMap::addSubdomainMap使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CookieMap
的用法示例。
在下文中一共展示了CookieMap::addSubdomainMap方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: findOrCreateCookieMap
CookieMap* CookieManager::findOrCreateCookieMap(CookieMap* protocolMap, const String& domain, bool findOnly)
{
// Explode the domain with the '.' delimiter
Vector<String> delimitedHost;
domain.split(".", delimitedHost);
CookieMap* curMap = protocolMap;
size_t hostSize = delimitedHost.size();
CookieLog("CookieManager - looking at protocol map %s \n", protocolMap->getName().utf8().data());
// Find & create necessary CookieMaps by traversing down the domain tree
// Each CookieMap represent a subsection of the domain, delimited by "."
int i = hostSize - 1;
while (i >= 0) {
CookieLog("CookieManager - finding %s in currentmap\n", delimitedHost[i].utf8().data());
CookieMap* nextMap = curMap->getSubdomainMap(delimitedHost[i]);
if (!nextMap) {
CookieLog("CookieManager - cannot find map\n");
if (findOnly)
return 0;
CookieLog("CookieManager - creating %s in currentmap %s\n", delimitedHost[i].utf8().data(), curMap->getName().utf8().data());
nextMap = new CookieMap(delimitedHost[i]);
CookieLog("CookieManager - adding subdomain to map\n");
curMap->addSubdomainMap(delimitedHost[i], nextMap);
}
curMap = nextMap;
i--;
}
return curMap;
}