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


C++ LLDate::asString方法代码示例

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


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

示例1: addEntry

//static
void LLFloaterBlacklist::addEntry(LLUUID key, LLSD data)
{
	if(key.notNull())
	{
		if(!data.has("entry_type")) 
			LL_WARNS("FloaterBlacklistAdd") << "addEntry called with no entry type, specify LLAssetType::Etype" << LL_ENDL;
		else if(!data.has("entry_name"))
			LL_WARNS("FloaterBlacklistAdd") << "addEntry called with no entry name, specify the name that should appear in the listing for this entry." << LL_ENDL;
		else
		{
			if(!data.has("entry_date"))
			{
				LLDate* curdate = new LLDate(time_corrected());
				std::string input_date = curdate->asString();
				input_date.replace(input_date.find("T"),1," ");
				input_date.resize(input_date.size() - 1);
				data["entry_date"] = input_date;
			}
			if(data["entry_type"].asString() == "1")
			{
			  //remove sounds
			  LLUUID sound_id=LLUUID(key);
			  gVFS->removeFile(sound_id,LLAssetType::AT_SOUND);
			  std::string wav_path= gDirUtilp->getExpandedFilename(LL_PATH_CACHE,sound_id.asString()) + ".dsf";
			  if(LLAPRFile::isExist(wav_path, LL_APR_RPB))
				LLAPRFile::remove(wav_path);
			  gAudiop->removeAudioData(sound_id);
			}
			blacklist_entries.insert(std::pair<LLUUID,LLSD>(key,data));
			updateBlacklists();
		}
	}
	else
		LL_WARNS("FloaterBlacklistAdd") << "addEntry called with a null entry key, please specify LLUUID of asset." << LL_ENDL;
}
开发者ID:BillBarnhill,项目名称:SingularityViewer,代码行数:36,代码来源:llfloaterblacklist.cpp

示例2: stream

	void date_test_object_t::test<3>()
	{
		LLDate date;
		std::istringstream stream(VALID_DATE);
		std::string  expected_string = VALID_DATE;
		date.fromStream(stream);
		ensure_equals("fromStream failed", date.asString(), expected_string);
	}
开发者ID:9skunks,项目名称:imprudence,代码行数:8,代码来源:lldate_tut.cpp

示例3: v

	void SDTestObject::test<7>()
		// Test assignment and casting to various scalar types.  These
		// assignments should invoke the right conversion without it being
		// mentioned explicitly.  The few exceptions are marked SAD.
	{
		SDCleanupCheck check;
		
		LLSD v("  42.375");
		
		bool b = false;
		b = v;				ensure_equals("assign to bool", b, true);
		b = (bool)v;		ensure_equals("cast to bool", b, true);
		
		int i = 99;
		i = v;				ensure_equals("assign to int", i, 42);
		i = (int)v;			ensure_equals("cast to int", i, 42);
		
		double d = 3.14159;
		d = v;				ensure_equals("assign to double", d, 42.375);
		d = (double)v;		ensure_equals("cast to double", d, 42.375);
		
		std::string s = "yo";
// SAD	s = v;				ensure_equals("assign to string", s, "  42.375");
		s = (std::string)v;	ensure_equals("cast to string", s, "  42.375");

		std::string uuidStr = "b1e50c2b-b627-4d23-8a86-a65d97b6319b";
		v = uuidStr;
		LLUUID u;
		u = v;
					ensure_equals("assign to LLUUID", u, LLUUID(uuidStr));
// SAD	u = (LLUUID)v;
//					ensure_equals("cast to LLUUID", u, LLUUID(uuidStr));
		
		std::string dateStr = "2005-10-24T15:00:00Z";
		v = dateStr;
		LLDate date;
		date = v;
					ensure_equals("assign to LLDate", date.asString(), dateStr);
// SAD	date = (LLDate)v;
//					ensure_equals("cast to LLDate", date.asString(), dateStr);
		
		std::string uriStr = "http://secondlife.com";
		v = uriStr;
		LLURI uri;
		uri = v;
					ensure_equals("assign to LLURI", uri.asString(), uriStr);
// SAD 	uri = (LLURI)v;
//					ensure_equals("cast to LLURI", uri.asString(), uriStr);
	}
开发者ID:Krazy-Bish-Margie,项目名称:Thunderstorm,代码行数:49,代码来源:llsd_new_tut.cpp

示例4: addNewItemToBlacklist

void FSWSAssetBlacklist::addNewItemToBlacklist(LLUUID id, std::string name, std::string region, LLAssetType::EType type, bool save)
{
	LLDate curdate = LLDate(time_corrected());
	std::string input_date = curdate.asString();
	input_date.replace(input_date.find("T"),1," ");
	input_date.resize(input_date.size() - 1);
	
	LLSD data;
	data["asset_name"] = name;
	data["asset_region"] = region;
	data["asset_type"] = type;
	data["asset_date"] = input_date;

	addNewItemToBlacklistData(LLUUID::generateNewID(id.asString() + "hash"), data, save);
}
开发者ID:wish-ds,项目名称:firestorm-ds,代码行数:15,代码来源:fswsassetblacklist.cpp

示例5: addNewItemToBlacklist

void FSWSAssetBlacklist::addNewItemToBlacklist(const LLUUID& id, const std::string& name, const std::string& region, LLAssetType::EType type, bool save)
{
	if (isBlacklisted(id, type))
	{
		return;
	}

	LLDate curdate = LLDate(time_corrected());
	std::string input_date = curdate.asString();
	input_date.replace(input_date.find("T"), 1, " ");
	input_date.resize(input_date.size() - 1);
	
	LLSD data;
	data["asset_name"] = name;
	data["asset_region"] = region;
	data["asset_type"] = type;
	data["asset_date"] = input_date;

	addNewItemToBlacklistData(id, data, save);
}
开发者ID:JohnMcCaffery,项目名称:Armadillo-Phoenix,代码行数:20,代码来源:fswsassetblacklist.cpp


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