本文整理汇总了C++中Cookie::Out方法的典型用法代码示例。如果您正苦于以下问题:C++ Cookie::Out方法的具体用法?C++ Cookie::Out怎么用?C++ Cookie::Out使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Cookie
的用法示例。
在下文中一共展示了Cookie::Out方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: RemoveCookieList
OP_STATUS CookiePath::RemoveCookieList(char * pathstr, char * namestr)
{
char* pathstrcopy = pathstr;
if(path.HasContent() && pathstr && *pathstr)
{
int p_len = path.Length();
if(path.Compare(pathstr,p_len) != 0)
return OpStatus::OK;
pathstr += p_len; // Remove first part, if path found
if(*pathstr == '/') pathstr++;
}
Cookie *ck = (Cookie*)cookie_list.First();
while(ck)
{
Cookie * next = ck->Suc();
if(pathstr && *pathstr) // if a path was specified test against it, otherwise delete it
{
OpString8 fullpath;
RETURN_IF_ERROR(GetFullPath(fullpath)); // get the full path
//the internal root part does not start with /, so get rid of it
fullpath.Delete(0,1);
int pathlen = fullpath.Length();
if(pathlen && fullpath.Compare(pathstrcopy, pathlen) == 0) //compare against the full path length since we want subpaths
{
OP_DELETE(ck);
}
}
else if((!namestr || !*namestr) || (ck->Name().Compare(namestr) == 0)) // remove it if no Name value was set or if the Name value equals
{
ck->Out();
OP_DELETE(ck);
}
ck = next;
}
CookiePath *cp = (CookiePath*)FirstChild();
while(cp)
{
cp->RemoveCookieList(pathstr, namestr);
cp = cp->Suc();
}
return OpStatus::OK;
}