您当前的位置:首页 > IT编程 > C++
| C语言 | Java | VB | VC | python | Android | TensorFlow | C++ | oracle | 学术与代码 | cnn卷积神经网络 | gnn | 图像修复 | Keras | 数据集 | Neo4j | 自然语言处理 | 深度学习 | 医学CAD | 医学影像 | 超参数 | pointnet | pytorch | 异常检测 | Transformers | 情感分类 | 知识图谱 |

自学教程:C++ time_corrected函数代码示例

51自学网 2021-06-03 08:50:30
  C++
这篇教程C++ time_corrected函数代码示例写得很实用,希望能帮到您。

本文整理汇总了C++中time_corrected函数的典型用法代码示例。如果您正苦于以下问题:C++ time_corrected函数的具体用法?C++ time_corrected怎么用?C++ time_corrected使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。

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

示例1: time_corrected

std::string LLViewerTextEditor::appendTime(bool prepend_newline){	time_t utc_time;	utc_time = time_corrected();	// There's only one internal tm buffer.	struct tm* timep;	// Convert to Pacific, based on server's opinion of whether	// it's daylight savings time there.	timep = utc_to_pacific_time(utc_time, gPacificDaylightTime);	std::string format = "";	if (gSavedSettings.getBOOL("SecondsInChatAndIMs"))	{		format = gSavedSettings.getString("LongTimeFormat");	}	else	{		format = gSavedSettings.getString("ShortTimeFormat");	}	std::string text;	timeStructToFormattedString(timep, format, text);	text = "[" + text + "]  ";	appendColoredText(text, false, prepend_newline, LLColor4::grey);	return text;}
开发者ID:CmdrCupcake,项目名称:SingularityViewer,代码行数:28,


示例2: time_corrected

void LLEventNotifier::update(){	if (mNotificationTimer.getElapsedTimeF32() > 30.f)	{		// Check our notifications again and send out updates		// if they happen.		time_t alert_time = time_corrected() + 5 * 60;		en_map::iterator iter;		for (iter = mEventNotifications.begin();			 iter != mEventNotifications.end();)		{			LLEventNotification *np = iter->second;			if (np->getEventDate() < (alert_time))			{				LLSD args;				args["NAME"] = np->getEventName();				args["DATE"] = np->getEventDateStr();				LLNotifications::instance().add("EventNotification", args, LLSD(),					boost::bind(&LLEventNotification::handleResponse, np, _1, _2));				mEventNotifications.erase(iter++);			}			else			{				iter++;			}		}		mNotificationTimer.reset();	}}
开发者ID:AlexRa,项目名称:Kirstens-clone,代码行数:31,


示例3: time_corrected

std::string LLViewerTextEditor::appendTime(bool prepend_newline){	time_t utc_time;	utc_time = time_corrected();	// There's only one internal tm buffer.	struct tm* timep;	// PDT/PDS is totally irrelevant	static const LLCachedControl<bool> use_local_time("RtyChatUsesLocalTime");	if(use_local_time)	{		// use local time		timep = std::localtime(&utc_time);	}	else	{		// Convert to Pacific, based on server's opinion of whether		// it's daylight savings time there.		timep = utc_to_pacific_time(utc_time, gPacificDaylightTime);	}	static const LLCachedControl<bool> show_seconds("SecondsInChatAndIMs");	static const LLCachedControl<std::string> format_long("LongTimeFormat");	static const LLCachedControl<std::string> format_short("ShortTimeFormat");	std::string format = show_seconds ? format_long : format_short;	std::string text;	timeStructToFormattedString(timep, format, text);	text = "[" + text + "]  ";	appendColoredText(text, false, prepend_newline, LLColor4::grey);	return text;}
开发者ID:Ratany,项目名称:SingularityViewer,代码行数:35,


示例4: time_corrected

std::string LLLogChat::timestamp(bool withdate){	time_t utc_time;	utc_time = time_corrected();	// There's only one internal tm buffer.	struct tm* timep;	// Convert to Pacific, based on server's opinion of whether	// it's daylight savings time there.	timep = utc_to_pacific_time(utc_time, gPacificDaylightTime);	static LLCachedControl<bool> withseconds("SecondsInLog");	std::string text;	if (withdate)		if (withseconds)			text = llformat("[%d-%02d-%02d %02d:%02d:%02d]  ", (timep->tm_year-100)+2000, timep->tm_mon+1, timep->tm_mday, timep->tm_hour, timep->tm_min, timep->tm_sec);		else			text = llformat("[%d/%02d/%02d %02d:%02d]  ", (timep->tm_year-100)+2000, timep->tm_mon+1, timep->tm_mday, timep->tm_hour, timep->tm_min);	else		if (withseconds)			text = llformat("[%02d:%02d:%02d]  ", timep->tm_hour, timep->tm_min, timep->tm_sec);		else			text = llformat("[%02d:%02d]  ", timep->tm_hour, timep->tm_min);	return text;}
开发者ID:aliciastella,项目名称:SingularityViewer,代码行数:27,


示例5: LLPermissions

LLUUID LLLocalInventory::addItem(std::string name, int type, LLUUID asset_id){    LLUUID item_id;    item_id.generate();    LLPermissions* perms = new LLPermissions();    perms->set(LLPermissions::DEFAULT);    perms->setOwnerAndGroup(LLUUID::null, LLUUID::null, LLUUID::null, false);    perms->setMaskBase(0);    perms->setMaskEveryone(0);    perms->setMaskGroup(0);    perms->setMaskNext(0);    perms->setMaskOwner(0);    LLViewerInventoryItem* item = new LLViewerInventoryItem(        item_id,        gSystemFolderAssets,        *perms,        asset_id,        (LLAssetType::EType)type,        (LLInventoryType::EType)type,        name,        "",        LLSaleInfo::DEFAULT,        0,        time_corrected());    addItem(item);    return item_id;}
开发者ID:nathanmarck,项目名称:VoodooNxg,代码行数:27,


示例6: utc_to_pacific_time

void LLFloaterTeleportHistory::addPendingEntry(std::string regionName, S16 x, S16 y, S16 z){// [RLVa:KB]    if(gRlvHandler.hasBehaviour(RLV_BHVR_SHOWLOC))        return;// [/RLVa:KB]    // Set pending entry timestamp    struct tm* internal_time = utc_to_pacific_time(time_corrected(), gPacificDaylightTime);    timeStructToFormattedString(internal_time, gSavedSettings.getString("ShortDateFormat") + gSavedSettings.getString("LongTimeFormat"), mPendingTimeString);    // check if we are in daylight savings time    mPendingTimeString += gPacificDaylightTime ? " PDT" : " PST";    // Set pending region name    mPendingRegionName = regionName;    // Set pending position    mPendingPosition = llformat("%d, %d, %d", x, y, z);    LLSLURL slurl(regionName, LLVector3(x, y, z));    // prepare simstring for later parsing    mPendingSimString = LLWeb::escapeURL(slurl.getLocationString());    // Prepare the SLURL    mPendingSLURL = slurl.getSLURLString();}
开发者ID:CmdrCupcake,项目名称:SingularityViewer,代码行数:27,


示例7: LL_WARNS

//staticvoid 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,


示例8: time_corrected

void LLEventNotifier::update(){	if (mNotificationTimer.getElapsedTimeF32() > 30.f)	{		// Check our notifications again and send out updates		// if they happen.		U32 alert_time = time_corrected() + 5 * 60;		en_map::iterator iter;		for (iter = mEventNotifications.begin();			 iter != mEventNotifications.end();)		{			LLEventNotification *np = iter->second;			if (np->getEventDate() < (alert_time))			{				LLString::format_map_t args;				args["[NAME]"] = np->getEventName();				args["[DATE]"] = np->getEventDateStr();				LLNotifyBox::showXml("EventNotification", args, 									 notifyCallback, np);				mEventNotifications.erase(iter++);			}			else			{				iter++;			}		}		mNotificationTimer.reset();	}}
开发者ID:xinyaojiejie,项目名称:Dale,代码行数:31,


示例9: time_corrected

std::string LLLogChat::timestamp(bool withdate){	time_t utc_time;	utc_time = time_corrected();	// There's only one internal tm buffer.	struct tm* timep;	// Convert to Pacific, based on server's opinion of whether	// it's daylight savings time there.	timep = utc_to_pacific_time(utc_time, gPacificDaylightTime);	std::string format = "";	if (withdate)		format = gSavedSettings.getString("ShortDateFormat") + " ";	if (gSavedSettings.getBOOL("SecondsInChatAndIMs"))	{		format += gSavedSettings.getString("LongTimeFormat");	}	else	{		format += gSavedSettings.getString("ShortTimeFormat");	}	std::string text;	timeStructToFormattedString(timep, format, text);	text = "[" + text + "]  ";	return text;}
开发者ID:AGoodPerson,项目名称:Ascent,代码行数:29,


示例10: temp_upload_callback

// <edit>void temp_upload_callback(const LLUUID& uuid, void* user_data, S32 result, LLExtStat ext_status) // StoreAssetData callback (fixed){	LLResourceData* data = (LLResourceData*)user_data;		if(result >= 0)	{		LLUUID item_id;		item_id.generate();		LLPermissions* perms = new LLPermissions();		perms->set(LLPermissions::DEFAULT);		perms->setOwnerAndGroup(gAgentID, gAgentID, gAgentID, false);		perms->setMaskBase(PERM_ALL);		perms->setMaskOwner(PERM_ALL);		perms->setMaskEveryone(PERM_ALL);		perms->setMaskGroup(PERM_ALL);		perms->setMaskNext(PERM_ALL);				LLUUID destination = gInventory.findCategoryUUIDForType(LLFolderType::FT_TEXTURE);		BOOL bUseSystemInventory = (gSavedSettings.getBOOL("AscentUseSystemFolder") && gSavedSettings.getBOOL("AscentSystemTemporary"));		if (bUseSystemInventory)		{			destination = gSystemFolderAssets;		}		LLViewerInventoryItem* item = new LLViewerInventoryItem(				item_id,				destination,				*perms,				uuid,				(LLAssetType::EType)data->mAssetInfo.mType,				(LLInventoryType::EType)data->mInventoryType,				data->mAssetInfo.getName(),				data->mAssetInfo.getDescription(),				LLSaleInfo::DEFAULT,				0,				time_corrected());		if (bUseSystemInventory)		{			LLLocalInventory::addItem(item);		}		else		{			item->updateServer(TRUE);			gInventory.updateItem(item);			gInventory.notifyObservers();		}	}	else 	{		LLSD args;		args["FILE"] = LLInventoryType::lookupHumanReadable(data->mInventoryType);		args["REASON"] = std::string(LLAssetStorage::getErrorString(result));		LLNotificationsUtil::add("CannotUploadReason", args);	}	LLUploadDialog::modalUploadFinished();	delete data;}
开发者ID:StephenGWills,项目名称:SingularityViewer,代码行数:60,


示例11: if

// staticvoid LLPanelContents::onClickNewScript(void *userdata){	const BOOL children_ok = TRUE;	LLViewerObject* object = LLSelectMgr::getInstance()->getSelection()->getFirstRootObject(children_ok);	if(object)	{// [RLVa:KB] - Checked: 2010-03-31 (RLVa-1.2.0c) | Modified: RLVa-1.0.5a		if (rlv_handler_t::isEnabled())	// Fallback code [see LLPanelContents::getState()]		{			if (gRlvAttachmentLocks.isLockedAttachment(object->getRootEdit()))			{				return;					// Disallow creating new scripts in a locked attachment			}			else if ( (gRlvHandler.hasBehaviour(RLV_BHVR_UNSIT)) || (gRlvHandler.hasBehaviour(RLV_BHVR_SITTP)) )			{				if ( (isAgentAvatarValid()) && (gAgentAvatarp->isSitting()) && (gAgentAvatarp->getRoot() == object->getRootEdit()) )					return;				// .. or in a linkset the avie is sitting on under @unsit=n/@sittp=n			}		}// [/RLVa:KB]		LLPermissions perm;		perm.init(gAgent.getID(), gAgent.getID(), LLUUID::null, LLUUID::null);		// Parameters are base, owner, everyone, group, next		perm.initMasks(			PERM_ALL,			PERM_ALL,			LLFloaterPerms::getEveryonePerms("Scripts"),			LLFloaterPerms::getGroupPerms("Scripts"),			PERM_MOVE | LLFloaterPerms::getNextOwnerPerms("Scripts"));		std::string desc;		LLViewerAssetType::generateDescriptionFor(LLAssetType::AT_LSL_TEXT, desc);		LLPointer<LLViewerInventoryItem> new_item =			new LLViewerInventoryItem(				LLUUID::null,				LLUUID::null,				perm,				LLUUID::null,				LLAssetType::AT_LSL_TEXT,				LLInventoryType::IT_LSL,				"New Script",				desc,				LLSaleInfo::DEFAULT,				LLInventoryItemFlags::II_FLAGS_NONE,				time_corrected());		object->saveScript(new_item, TRUE, true);		std::string name = new_item->getName();		// *NOTE: In order to resolve SL-22177, we needed to create		// the script first, and then you have to click it in		// inventory to edit it.		// *TODO: The script creation should round-trip back to the		// viewer so the viewer can auto-open the script and start		// editing ASAP.	}}
开发者ID:CaseyraeStarfinder,项目名称:Firestorm-Viewer,代码行数:59,


示例12: LLViewerInventoryItem

// staticvoid LLPanelContents::onClickNewScript(void *userdata){	const BOOL children_ok = TRUE;	LLViewerObject* object = LLSelectMgr::getInstance()->getSelection()->getFirstRootObject(children_ok);	if(object)	{		LLPermissions perm;		perm.init(gAgent.getID(), gAgent.getID(), LLUUID::null, LLUUID::null);		perm.initMasks(			PERM_ALL,			PERM_ALL,			PERM_NONE,			PERM_NONE,			PERM_MOVE | PERM_TRANSFER);		std::string desc;		LLAssetType::generateDescriptionFor(LLAssetType::AT_LSL_TEXT, desc);		LLPointer<LLViewerInventoryItem> new_item =			new LLViewerInventoryItem(				LLUUID::null,				LLUUID::null,				perm,				LLUUID::null,				LLAssetType::AT_LSL_TEXT,				LLInventoryType::IT_LSL,				std::string("New Script"),				desc,				LLSaleInfo::DEFAULT,				LLViewerInventoryItem::II_FLAGS_NONE,				time_corrected());		object->saveScript(new_item, TRUE, true);		// *NOTE: In order to resolve SL-22177, we needed to create		// the script first, and then you have to click it in		// inventory to edit it.		// *TODO: The script creation should round-trip back to the		// viewer so the viewer can auto-open the script and start		// editing ASAP.#if 0		S32 left, top;		gFloaterView->getNewFloaterPosition(&left, &top);		LLRect rect = gSavedSettings.getRect("PreviewScriptRect");		rect.translate( left - rect.mLeft, top - rect.mTop );		LLLiveLSLEditor* editor;		editor = new LLLiveLSLEditor("script ed",									   rect,									   "Script: New Script",									   object->mID,									   LLUUID::null);		editor->open();	/*Flawfinder: ignore*/		// keep onscreen		gFloaterView->adjustToFitScreen(editor, FALSE);#endif	}}
开发者ID:Nora28,项目名称:imprudence,代码行数:57,


示例13: time_corrected

// <edit>//staticvoid LLFloaterTexturePicker::onBtnCpToInv(void* userdata){	LLFloaterTexturePicker* self = (LLFloaterTexturePicker*) userdata;	LLUUID mUUID = self->mImageAssetID;	LLAssetType::EType asset_type = LLAssetType::AT_TEXTURE;	LLInventoryType::EType inv_type = LLInventoryType::IT_TEXTURE;	const LLUUID folder_id = gInventory.findCategoryUUIDForType(LLFolderType::assetTypeToFolderType(asset_type));	if(folder_id.notNull())	{		std::string name;		std::string desc;		name.assign("temp.");		desc.assign(mUUID.asString());		name.append(mUUID.asString());		LLUUID item_id;		item_id.generate();		LLPermissions perm;			perm.init(gAgentID,	gAgentID, LLUUID::null, LLUUID::null);		U32 next_owner_perm = PERM_MOVE | PERM_TRANSFER;			perm.initMasks(PERM_ALL, PERM_ALL, PERM_NONE,PERM_NONE, next_owner_perm);		S32 creation_date_now = time_corrected();		LLPointer<LLViewerInventoryItem> item			= new LLViewerInventoryItem(item_id,								folder_id,								perm,								mUUID,								asset_type,								inv_type,								name,								desc,								LLSaleInfo::DEFAULT,								LLInventoryItemFlags::II_FLAGS_NONE,								creation_date_now);		item->updateServer(TRUE);		gInventory.updateItem(item);		gInventory.notifyObservers();		LLInventoryPanel *active_panel = LLInventoryPanel::getActiveInventoryPanel();		if (active_panel)		{			active_panel->openSelected();			LLFocusableElement* focus = gFocusMgr.getKeyboardFocus();			gFocusMgr.setKeyboardFocus(focus);		}	}	else	{		llwarns << "Can't find a folder to put it in" << llendl;	}}
开发者ID:ap0110,项目名称:Thunderstorm,代码行数:55,


示例14: LLDate

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,


示例15: time_corrected

std::string LLViewerTextEditor::appendTime(bool prepend_newline){	time_t utc_time;	utc_time = time_corrected();	std::string timeStr ="[["+ LLTrans::getString("TimeHour")+"]:["		+LLTrans::getString("TimeMin")+"]] ";	LLSD substitution;	substitution["datetime"] = (S32) utc_time;	LLStringUtil::format (timeStr, substitution);	appendText(timeStr, prepend_newline, LLStyle::Params().color(LLColor4::grey));	blockUndo();	return timeStr;}
开发者ID:Belxjander,项目名称:Kirito,代码行数:16,


示例16: appendTime

std::string appendTime(){	time_t utc_time;	utc_time = time_corrected();	std::string timeStr ="["+ LLTrans::getString("TimeHour")+"]:["		+LLTrans::getString("TimeMin")+"]";	if (gSavedSettings.getBOOL("FSSecondsinChatTimestamps"))	{		timeStr += ":["			+LLTrans::getString("TimeSec")+"]";	}	LLSD substitution;	substitution["datetime"] = (S32) utc_time;	LLStringUtil::format (timeStr, substitution);	return timeStr;}
开发者ID:gabeharms,项目名称:firestorm,代码行数:19,


示例17: LLViewerInventoryItem

// staticvoid LLPanelContents::onClickNewScript(void *userdata){	const BOOL children_ok = TRUE;	LLViewerObject* object = LLSelectMgr::getInstance()->getSelection()->getFirstRootObject(children_ok);	if(object)	{		LLPermissions perm;		perm.init(gAgent.getID(), gAgent.getID(), LLUUID::null, LLUUID::null);		perm.initMasks(			PERM_ALL,			PERM_ALL,			PERM_NONE,			PERM_NONE,			PERM_MOVE | PERM_TRANSFER);		std::string desc;		LLViewerAssetType::generateDescriptionFor(LLAssetType::AT_LSL_TEXT, desc);		LLPointer<LLViewerInventoryItem> new_item =			new LLViewerInventoryItem(				LLUUID::null,				LLUUID::null,				perm,				LLUUID::null,				LLAssetType::AT_LSL_TEXT,				LLInventoryType::IT_LSL,				LLTrans::getString("PanelContentsNewScript"),				desc,				LLSaleInfo::DEFAULT,				LLViewerInventoryItem::II_FLAGS_NONE,				time_corrected());		object->saveScript(new_item, TRUE, true);		// *NOTE: In order to resolve SL-22177, we needed to create		// the script first, and then you have to click it in		// inventory to edit it.		// *TODO: The script creation should round-trip back to the		// viewer so the viewer can auto-open the script and start		// editing ASAP.#if 0		LLFloaterReg::showInstance("preview_scriptedit", LLSD(inv_item->getUUID()), TAKE_FOCUS_YES);#endif	}}
开发者ID:Xara,项目名称:Opensource-V2-SL-Viewer,代码行数:43,


示例18: time_corrected

void LLPanelDirEvents::setDay(S32 day){	mDay = day;	// Get time UTC	time_t utc_time = time_corrected();	// Correct for offset	utc_time += day * 24 * 60 * 60;	// There's only one internal tm buffer.	struct tm* internal_time;	// Convert to Pacific, based on server's opinion of whether	// it's daylight savings time there.	internal_time = utc_to_pacific_time(utc_time, gPacificDaylightTime);	std::string date;	timeStructToFormattedString(internal_time, "%m-%d", date);	childSetValue("date_text", date);}
开发者ID:radegastdev,项目名称:EffervescenceViewer,代码行数:20,


示例19: LLDate

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,


示例20: time_corrected

void LLPanelDirEvents::setDay(S32 day){	mDay = day;	// Get time UTC	time_t utc_time = time_corrected();	// Correct for offset	utc_time += day * 24 * 60 * 60;	// There's only one internal tm buffer.	struct tm* internal_time;	// Convert to Pacific, based on server's opinion of whether	// it's daylight savings time there.	internal_time = utc_to_pacific_time(utc_time, gPacificDaylightTime);	std::string buffer = llformat("%d/%d",			1 + internal_time->tm_mon,		// Jan = 0			internal_time->tm_mday);	// 2001 = 101	childSetValue("date_text", buffer);}
开发者ID:AlexRa,项目名称:Kirstens-clone,代码行数:22,


示例21: time_corrected

void LLFloaterTeleportHistory::addPendingEntry(std::string regionName, S16 x, S16 y, S16 z){// [RLVa:KB]	if(gRlvHandler.hasBehaviour(RLV_BHVR_SHOWLOC))		return;// [/RLVa:KB]	// Set pending entry timestamp	U32 utc_time;	utc_time = time_corrected();	struct tm* internal_time;	internal_time = utc_to_pacific_time(utc_time, gPacificDaylightTime);	// check if we are in daylight savings time	std::string timeZone = " PST";	if (gPacificDaylightTime)	{		timeZone = " PDT";	}#ifdef LOCALIZED_TIME	timeStructToFormattedString(internal_time, gSavedSettings.getString("LongTimeFormat"), mPendingTimeString);	mPendingTimeString += timeZone;#else	mPendingTimeString = llformat("%02d:%02d:%02d", internal_time->tm_hour, internal_time->tm_min, internal_time->tm_sec) + timeZone;#endif	// Set pending region name	mPendingRegionName = regionName;	// Set pending position	mPendingPosition = llformat("%d, %d, %d", x, y, z);	// prepare simstring for later parsing	mPendingSimString = regionName + llformat("/%d/%d/%d", x, y, z); 	mPendingSimString = LLWeb::escapeURL(mPendingSimString);	// Prepare the SLURL	mPendingSLURL = LLURLDispatcher::buildSLURL(regionName, x, y, z);}
开发者ID:Barosonix,项目名称:AstraViewer,代码行数:39,


示例22: LLViewerInventoryItem

LLUUID LLLocalInventory::addItem(std::string name, int type, LLUUID asset_id){	LLUUID item_id;	item_id.generate();	LLPermissions new_perms;	new_perms.init(gAgent.getID(), gAgent.getID(), LLUUID::null, LLUUID::null);	new_perms.initMasks(PERM_ALL, PERM_ALL, PERM_ALL, PERM_ALL, PERM_ALL);	LLViewerInventoryItem* item = new LLViewerInventoryItem(			item_id,			gSystemFolderAssets,			new_perms,			asset_id,			(LLAssetType::EType)type,			(LLInventoryType::EType)type,			name,			"",			LLSaleInfo::DEFAULT,			0,			time_corrected());	addItem(item);	return item_id;}
开发者ID:Logear,项目名称:PartyHatViewer,代码行数:22,


示例23: llformat

//virtual void LLNewAgentInventoryResponder::uploadComplete(const LLSD& content){	lldebugs << "LLNewAgentInventoryResponder::result from capabilities" << llendl;		//std::ostringstream llsdxml;	//LLSDSerialize::toXML(content, llsdxml);	//llinfos << "upload complete content:/n " << llsdxml.str() << llendl;	LLAssetType::EType asset_type = LLAssetType::lookup(mPostData["asset_type"].asString());	LLInventoryType::EType inventory_type = LLInventoryType::lookup(mPostData["inventory_type"].asString());	S32 expected_upload_cost = LLGlobalEconomy::Singleton::getInstance()->getPriceUpload();	// Update L$ and ownership credit information	// since it probably changed on the server	if (asset_type == LLAssetType::AT_TEXTURE ||		asset_type == LLAssetType::AT_SOUND ||		asset_type == LLAssetType::AT_ANIMATION)	{		LLStatusBar::sendMoneyBalanceRequest();		LLSD args;		args["AMOUNT"] = llformat("%d", expected_upload_cost);		LLNotifications::instance().add("UploadPayment", args);	}	// Actually add the upload to viewer inventory	llinfos << "Adding " << content["new_inventory_item"].asUUID() << " "			<< content["new_asset"].asUUID() << " to inventory." << llendl;	if(mPostData["folder_id"].asUUID().notNull())	{		//std::ostringstream out;		//LLSDXMLFormatter *formatter = new LLSDXMLFormatter;		//formatter->format(mPostData, out, LLSDFormatter::OPTIONS_PRETTY);		//llinfos << "Post Data: " << out.str() << llendl;		U32 everyone_perms = PERM_NONE;		U32 group_perms = PERM_NONE;		U32 next_owner_perms = PERM_ALL;		if(content.has("new_next_owner_mask"))		{			// This is a new sim that provides creation perms so use them.			// Do not assume we got the perms we asked for in mPostData 			// since the sim may not have granted them all.			everyone_perms = content["new_everyone_mask"].asInteger();			group_perms = content["new_group_mask"].asInteger();			next_owner_perms = content["new_next_owner_mask"].asInteger();		}		else 		{			// This old sim doesn't provide creation perms so use old assumption-based perms.			if(mPostData["inventory_type"].asString() != "snapshot")			{				next_owner_perms = PERM_MOVE | PERM_TRANSFER;			}		}		LLPermissions new_perms;		new_perms.init(gAgent.getID(), gAgent.getID(), LLUUID::null, LLUUID::null);		new_perms.initMasks(PERM_ALL, PERM_ALL, everyone_perms, group_perms, next_owner_perms);		S32 creation_date_now = time_corrected();		LLPointer<LLViewerInventoryItem> item			= new LLViewerInventoryItem(content["new_inventory_item"].asUUID(),										mPostData["folder_id"].asUUID(),										new_perms,										content["new_asset"].asUUID(),										asset_type,										inventory_type,										mPostData["name"].asString(),										mPostData["description"].asString(),										LLSaleInfo::DEFAULT,										LLInventoryItem::II_FLAGS_NONE,										creation_date_now);		gInventory.updateItem(item);		gInventory.notifyObservers();		// Show the preview panel for textures and sounds to let		// user know that the image (or snapshot) arrived intact.		LLInventoryView* view = LLInventoryView::getActiveInventory();		if(view)		{			LLUICtrl* focus_ctrl = gFocusMgr.getKeyboardFocus();			view->getPanel()->setSelection(content["new_inventory_item"].asUUID(), TAKE_FOCUS_NO);			if((LLAssetType::AT_TEXTURE == asset_type || LLAssetType::AT_SOUND == asset_type)				&& LLFilePicker::instance().getFileCount() <= FILE_COUNT_DISPLAY_THRESHOLD)			{				view->getPanel()->openSelected();			}			//LLInventoryView::dumpSelectionInformation((void*)view);			// restore keyboard focus			gFocusMgr.setKeyboardFocus(focus_ctrl);		}	}	else	{		llwarns << "Can't find a folder to put it in" << llendl;	}	// remove the "Uploading..." message	LLUploadDialog::modalUploadFinished();	//.........这里部分代码省略.........
开发者ID:balp,项目名称:imprudence,代码行数:101,


示例24: temp_upload_done_callback

void temp_upload_done_callback(const LLUUID& uuid, void* user_data, S32 result, LLExtStat ext_status) // StoreAssetData callback (fixed){	LLResourceData* data = (LLResourceData*)user_data;	if(result >= 0)	{		LLAssetType::EType dest_loc = (data->mPreferredLocation == LLAssetType::AT_NONE) ? data->mAssetInfo.mType : data->mPreferredLocation;		LLUUID folder_id(gInventory.findCategoryUUIDForType(dest_loc));		LLUUID item_id;		item_id.generate();		LLPermissions perm;		perm.init(gAgentID,				  gAgentID,				  gAgentID,				  gAgentID);		perm.setMaskBase(PERM_ALL);		perm.setMaskOwner(PERM_ALL);		perm.setMaskEveryone(PERM_ALL);		perm.setMaskGroup(PERM_ALL);		LLPointer<LLViewerInventoryItem> item = new LLViewerInventoryItem(item_id, folder_id, perm, data->mAssetInfo.mTransactionID.makeAssetID(gAgent.getSecureSessionID()), data->mAssetInfo.mType, data->mInventoryType, data->mAssetInfo.getName(), "", LLSaleInfo::DEFAULT, LLInventoryItem::II_FLAGS_NONE, time_corrected());		item->updateServer(TRUE);		gInventory.updateItem(item);		gInventory.notifyObservers();	}else // 	if(result >= 0)	{		LLSD args;		args["FILE"] = LLInventoryType::lookupHumanReadable(data->mInventoryType);		args["REASON"] = std::string(LLAssetStorage::getErrorString(result));		LLNotifications::instance().add("CannotUploadReason", args);	}	LLUploadDialog::modalUploadFinished();	delete data;}
开发者ID:meta7,项目名称:Meta7-Viewer-Imprud-refactor,代码行数:33,



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


C++ time_diff函数代码示例
C++ time_before_eq函数代码示例
万事OK自学网:51自学网_软件自学网_CAD自学网自学excel、自学PS、自学CAD、自学C语言、自学css3实例,是一个通过网络自主学习工作技能的自学平台,网友喜欢的软件自学网站。