本文整理汇总了C++中Cookie::GetLastUsed方法的典型用法代码示例。如果您正苦于以下问题:C++ Cookie::GetLastUsed方法的具体用法?C++ Cookie::GetLastUsed怎么用?C++ Cookie::GetLastUsed使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Cookie
的用法示例。
在下文中一共展示了Cookie::GetLastUsed方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: GetLeastRecentlyUsed
Cookie* CookiePath::GetLeastRecentlyUsed(time_t last_used, time_t this_time)
{
time_t new_last_used = last_used;
Cookie* ck = 0;
Cookie *ck_unused = NULL;
Cookie* new_ck = (Cookie*) cookie_list.First();
while (new_ck)
{
Cookie* next_ck = new_ck->Suc();
if (new_ck->Expires() && new_ck->Expires() < this_time)
{
OP_DELETE(new_ck);
}
else if (new_ck->GetLastUsed() <= new_last_used && !new_ck->ProtectedCookie())
{
if(new_ck->GetLastUsed())
{
new_last_used = new_ck->GetLastUsed();
ck = new_ck;
}
else if(!ck_unused)
ck_unused = new_ck;
}
new_ck = next_ck;
}
CookiePath* cp = (CookiePath*) FirstChild();
while (cp)
{
new_ck = cp->GetLeastRecentlyUsed(new_last_used, this_time);
if (new_ck)
{
if(new_ck->GetLastUsed())
{
ck = new_ck;
new_last_used = ck->GetLastUsed();
}
else
ck_unused = new_ck;
}
cp = cp->Suc();
}
return (ck ? ck : ck_unused);
}
示例2: DebugWriteCookies
void CookiePath::DebugWriteCookies(FILE* fp)
{
fprintf(fp, " ");
DebugWritePath(fp);
fprintf(fp, ": \n");
Cookie* ck = (Cookie*) cookie_list.First();
while (ck)
{
fprintf(fp, " %s=%s; %lu; %d; %lu %s\n", ck->Name(), ck->Value(), ck->Expires(), ck->Secure(), ck->GetLastUsed(), (ck->DiscardAtExit() ? "; Discard on exit" : ""));
ck = ck->Suc();
}
CookiePath* cp = (CookiePath*) FirstChild();
while (cp)
{
cp->DebugWriteCookies(fp);
cp = cp->Suc();
}
}