本文整理汇总了C++中Cookie::Persistent方法的典型用法代码示例。如果您正苦于以下问题:C++ Cookie::Persistent方法的具体用法?C++ Cookie::Persistent怎么用?C++ Cookie::Persistent使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Cookie
的用法示例。
在下文中一共展示了Cookie::Persistent方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: WriteCookiesL
size_t CookiePath::WriteCookiesL(DataFile &fp, time_t this_time, BOOL dry_run)
{
size_t size = 0;
Cookie* ck = (Cookie*) cookie_list.First();
while (ck)
{
if(ck->Persistent(this_time))
{
DataFile_Record rec(TAG_COOKIE_ENTRY);
ANCHOR(DataFile_Record,rec);
rec.SetRecordSpec(fp.GetRecordSpec());
ck->FillDataFileRecordL(rec);
if (dry_run)
size += rec.CalculateLength();
else
rec.WriteRecordL(&fp);
}
ck = ck->Suc();
}
CookiePath* cp = (CookiePath*) FirstChild();
while (cp)
{
if (cp->HasCookies(this_time))
{
DataFile_Record rec(TAG_COOKIE_PATH_ENTRY);
ANCHOR(DataFile_Record,rec);
rec.SetRecordSpec(fp.GetRecordSpec());
rec.AddRecordL(TAG_COOKIE_PATH_NAME, cp->PathPart());
if (dry_run)
size += rec.CalculateLength();
else
rec.WriteRecordL(&fp);
size += cp->WriteCookiesL(fp, this_time, dry_run);
}
cp = cp->Suc();
}
{
DataFile_Record rec(TAG_COOKIE_PATH_END);
// spec is a pointer to existing field of object fp, there is no need to assert that it's not null
const DataRecord_Spec *spec = fp.GetRecordSpec();
rec.SetRecordSpec(spec);
if (dry_run)
size += ((rec.GetTag() & MSB_VALUE) == MSB_VALUE) ? spec->idtag_len : rec.CalculateLength();
else
rec.WriteRecordL(&fp);
}
return size;
}
示例2: RemoveNonPersistentCookies
void CookiePath::RemoveNonPersistentCookies()
{
time_t this_time = (time_t) (g_op_time_info->GetTimeUTC()/1000.0);
Cookie* ck = (Cookie*) cookie_list.First();
while (ck)
{
Cookie *ck1 = ck->Suc();
if (!ck->Persistent(this_time))
{
OP_DELETE(ck);
}
ck = ck1;
}
CookiePath* cp = (CookiePath*) FirstChild();
while (cp)
{
cp->RemoveNonPersistentCookies();
cp = cp->Suc();
}
}