当前位置: 首页>>代码示例>>C++>>正文


C++ DataFile::AppVersion方法代码示例

本文整理汇总了C++中DataFile::AppVersion方法的典型用法代码示例。如果您正苦于以下问题:C++ DataFile::AppVersion方法的具体用法?C++ DataFile::AppVersion怎么用?C++ DataFile::AppVersion使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在DataFile的用法示例。


在下文中一共展示了DataFile::AppVersion方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: ReadCookiesL

void CookiePath::ReadCookiesL(DataFile &fp, unsigned long  ver_no)
{
	Cookie_Item_Handler loaded_cookie;
	ANCHOR(Cookie_Item_Handler, loaded_cookie);
	OpStackAutoPtr<DataFile_Record> rec(0);

	rec.reset(fp.GetNextRecordL());
	while (rec.get() && rec->GetTag() != TAG_COOKIE_PATH_END)
	{
		switch(rec->GetTag())
		{
		case TAG_COOKIE_PATH_ENTRY:
			{
				rec->IndexRecordsL();

				OpString8 pth_name;
				ANCHOR(OpString8, pth_name);

				rec->GetIndexedRecordStringL(TAG_COOKIE_PATH_NAME, pth_name);

				BOOL is_full=FALSE;

				CookiePath* cp = GetCookiePathL(pth_name.CStr(), TRUE, is_full);

				if(cp == NULL)
				{
					LEAVE(OpStatus::ERR_NO_MEMORY);
				}

				cp->ReadCookiesL(fp, ver_no);
			}
			break;
		case TAG_COOKIE_ENTRY:
			{
				loaded_cookie.Clear();
				
				rec->IndexRecordsL();
				
				rec->GetIndexedRecordStringL(TAG_COOKIE_NAME, loaded_cookie.name);
				rec->GetIndexedRecordStringL(TAG_COOKIE_VALUE, loaded_cookie.value);
				
				loaded_cookie.expire = (time_t) rec->GetIndexedRecordUInt64L(TAG_COOKIE_EXPIRES);
				loaded_cookie.last_used = (time_t) rec->GetIndexedRecordUInt64L(TAG_COOKIE_LAST_USED);
				loaded_cookie.last_sync = (time_t) rec->GetIndexedRecordUInt64L(TAG_COOKIE_LAST_SYNC);

				loaded_cookie.flags.secure = rec->GetIndexedRecordBOOL(TAG_COOKIE_SECURE);
				loaded_cookie.flags.httponly = rec->GetIndexedRecordBOOL(TAG_COOKIE_HTTP_ONLY);
				
				loaded_cookie.flags.full_path_only = rec->GetIndexedRecordBOOL(TAG_COOKIE_NOT_FOR_PREFIX);
				loaded_cookie.flags.only_server = rec->GetIndexedRecordBOOL(TAG_COOKIE_ONLY_SERVER);
				loaded_cookie.flags.assigned = rec->GetIndexedRecordBOOL(TAG_COOKIE_ASSIGNED);
				loaded_cookie.flags.protected_cookie = rec->GetIndexedRecordBOOL(TAG_COOKIE_PROTECTED);
				
				loaded_cookie.version = rec->GetIndexedRecordUIntL(TAG_COOKIE_VERSION);

				switch (loaded_cookie.version)
				{
				case 0:
					loaded_cookie.cookie_type = NETSCAPE_COOKIE;
					break;
				case 1:
					loaded_cookie.cookie_type = COOKIE2_COOKIE;
					break;
				default:
					loaded_cookie.cookie_type = UNKNOWN_COOKIE;
				}

				rec->GetIndexedRecordStringL(TAG_COOKIE_COMMENT, loaded_cookie.comment);
				rec->GetIndexedRecordStringL(TAG_COOKIE_COMMENT_URL, loaded_cookie.comment_URL);
				rec->GetIndexedRecordStringL(TAG_COOKIE_RECVD_DOMAIN, loaded_cookie.domain);
				if(fp.AppVersion() >COOKIES_FILE_VERSION_BUGGY_RECVD_PATH)
				{
					rec->GetIndexedRecordStringL(TAG_COOKIE_RECVD_PATH, loaded_cookie.recvd_path);
				}
				else
				{
					OpStringS8 temp_path;
					ANCHOR(OpStringS8, temp_path);

					rec->GetIndexedRecordStringL(TAG_COOKIE_RECVD_PATH, temp_path);

					if(temp_path.Compare("/") == 0)
						loaded_cookie.recvd_path.TakeOver(temp_path);
					else
						LEAVE_IF_ERROR(loaded_cookie.recvd_path.SetConcat("/",temp_path));
				}
				rec->GetIndexedRecordStringL(TAG_COOKIE_PORT, loaded_cookie.port);
				
				loaded_cookie.flags.have_password = rec->GetIndexedRecordBOOL(TAG_COOKIE_HAVE_PASSWORD);
				loaded_cookie.flags.have_authentication= rec->GetIndexedRecordBOOL(TAG_COOKIE_HAVE_AUTHENTICATION);
				loaded_cookie.flags.accepted_as_third_party = rec->GetIndexedRecordBOOL(TAG_COOKIE_ACCEPTED_AS_THIRDPARTY);
				
				Cookie* ck = Cookie::CreateL(&loaded_cookie);
				
				ck->Into(&cookie_list);
			}
		}

		rec.reset(fp.GetNextRecordL());
	}
//.........这里部分代码省略.........
开发者ID:prestocore,项目名称:browser,代码行数:101,代码来源:url_cmp.cpp


注:本文中的DataFile::AppVersion方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。