• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

C++ rights_map_t类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



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

示例1: rights_map_t

void LLPanelFriends::confirmModifyRights(rights_map_t& ids, EGrantRevoke command)
{
	if (ids.empty()) return;
	
	LLSD args;
	if(ids.size() > 0)
	{
		rights_map_t* rights = new rights_map_t(ids);

		// for single friend, show their name
		if(ids.size() == 1)
		{
			LLUUID agent_id = ids.begin()->first;
			std::string first, last;
			if(gCacheName->getName(agent_id, first, last))
			{
				args["FIRST_NAME"] = first;
				args["LAST_NAME"] = last;	
			}
			if (command == GRANT)
			{
				LLNotifications::instance().add("GrantModifyRights", 
					args, 
					LLSD(), 
					boost::bind(&LLPanelFriends::modifyRightsConfirmation, this, _1, _2, rights));
			}
			else
			{
				LLNotifications::instance().add("RevokeModifyRights", 
					args, 
					LLSD(), 
					boost::bind(&LLPanelFriends::modifyRightsConfirmation, this, _1, _2, rights));
			}
		}
		else
		{
			if (command == GRANT)
			{
				LLNotifications::instance().add("GrantModifyRightsMultiple", 
					args, 
					LLSD(), 
					boost::bind(&LLPanelFriends::modifyRightsConfirmation, this, _1, _2, rights));
			}
			else
			{
				LLNotifications::instance().add("RevokeModifyRightsMultiple", 
					args, 
					LLSD(), 
					boost::bind(&LLPanelFriends::modifyRightsConfirmation, this, _1, _2, rights));
			}
		}
	}
}
开发者ID:EmeraldViewer,项目名称:EmeraldViewer,代码行数:53,代码来源:llfloaterfriends.cpp


示例2: rights_map_t

void LLPanelFriends::confirmModifyRights(rights_map_t& rights, EGrantRevoke command)
{
	if (rights.empty()) return;

	// Make a copy on the heap: rights is allocated on the stack.
	// This copy will be deleted in LLPanelFriends::modifyRightsConfirmation.
	rights_map_t* heap_rights = new rights_map_t(rights);

	// for single friend, show their name
	if (rights.size() == 1)
	{
		LLSD args;
		std::string fullname;
		if (LLAvatarNameCache::getPNSName(rights.begin()->first, fullname, friend_name_system()))
			args["NAME"] = fullname;

		if (command == GRANT)
		{
			LLNotificationsUtil::add("GrantModifyRights",
					args,
					LLSD(),
					boost::bind(&LLPanelFriends::modifyRightsConfirmation, this, _1, _2, heap_rights));
		}
		else
		{
			LLNotificationsUtil::add("RevokeModifyRights",
					args,
					LLSD(),
					boost::bind(&LLPanelFriends::modifyRightsConfirmation, this, _1, _2, heap_rights));
		}
	}
	else
	{
		if (command == GRANT)
		{
			LLNotificationsUtil::add("GrantModifyRightsMultiple",
					LLSD(),
					LLSD(),
					boost::bind(&LLPanelFriends::modifyRightsConfirmation, this, _1, _2, heap_rights));
		}
		else
		{
			LLNotificationsUtil::add("RevokeModifyRightsMultiple",
					LLSD(),
					LLSD(),
					boost::bind(&LLPanelFriends::modifyRightsConfirmation, this, _1, _2, heap_rights));
		}
	}
}
开发者ID:ArxNet,项目名称:SingularityViewer,代码行数:49,代码来源:llfloaterfriends.cpp


示例3: rights_map_t

void LLFloaterFriends::confirmModifyRights(rights_map_t& ids, EGrantRevoke command)
{
	if (ids.empty()) return;
	
	LLStringBase<char>::format_map_t args;
	if(ids.size() > 0)
	{
		// copy map of ids onto heap
		rights_map_t* rights = new rights_map_t(ids); 
		// package with panel pointer
		std::pair<LLFloaterFriends*, rights_map_t*>* user_data = new std::pair<LLFloaterFriends*, rights_map_t*>(this, rights);

		// for single friend, show their name
		if(ids.size() == 1)
		{
			LLUUID agent_id = ids.begin()->first;
			char first[DB_FIRST_NAME_BUF_SIZE];		/*Flawfinder: ignore*/
			char last[DB_LAST_NAME_BUF_SIZE];		/*Flawfinder: ignore*/
			if(gCacheName->getName(agent_id, first, last))
			{
				args["[FIRST_NAME]"] = first;
				args["[LAST_NAME]"] = last;	
			}
			if (command == GRANT)
			{
				gViewerWindow->alertXml("GrantModifyRights", args, modifyRightsConfirmation, user_data);
			}
			else
			{
				gViewerWindow->alertXml("RevokeModifyRights", args, modifyRightsConfirmation, user_data);
			}
		}
		else
		{
			if (command == GRANT)
			{
				gViewerWindow->alertXml("GrantModifyRightsMultiple", args, modifyRightsConfirmation, user_data);
			}
			else
			{
				gViewerWindow->alertXml("RevokeModifyRightsMultiple", args, modifyRightsConfirmation, user_data);
			}
		}
	}
}
开发者ID:Boy,项目名称:netbook,代码行数:45,代码来源:llfloaterfriends.cpp


示例4: sendRightsGrant

void LLFloaterFriends::sendRightsGrant(rights_map_t& ids)
{
	if (ids.empty()) return;

	LLMessageSystem* msg = gMessageSystem;

	// setup message header
	msg->newMessageFast(_PREHASH_GrantUserRights);
	msg->nextBlockFast(_PREHASH_AgentData);
	msg->addUUID(_PREHASH_AgentID, gAgent.getID());
	msg->addUUID(_PREHASH_SessionID, gAgent.getSessionID());

	rights_map_t::iterator id_it;
	rights_map_t::iterator end_it = ids.end();
	for(id_it = ids.begin(); id_it != end_it; ++id_it)
	{
		msg->nextBlockFast(_PREHASH_Rights);
		msg->addUUID(_PREHASH_AgentRelated, id_it->first);
		msg->addS32(_PREHASH_RelatedRights, id_it->second);
	}

	mNumRightsChanged = ids.size();
	gAgent.sendReliableMessage();
}
开发者ID:Boy,项目名称:netbook,代码行数:24,代码来源:llfloaterfriends.cpp


示例5: rights_map_t

void LLPanelFriends::confirmModifyRights(rights_map_t& ids, EGrantRevoke command)
{
	if (ids.empty()) return;
	
	LLSD args;
	if(ids.size() > 0)
	{
		rights_map_t* rights = new rights_map_t(ids);

		// for single friend, show their name
		if(ids.size() == 1)
		{
			LLUUID agent_id = ids.begin()->first;
			std::string first, last;
			if(gCacheName->getName(agent_id, first, last))
			{
				if (LLAvatarNameCache::useDisplayNames() && !gSavedSettings.getBOOL("LegacyNamesForFriends"))
				{
					LLAvatarName avatar_name;
					if (LLAvatarNameCache::get(agent_id, &avatar_name))
					{
						// Always show "Display Name [Legacy Name]" for security reasons
						first = avatar_name.getNames();
						size_t i = first.find(" ");
						if (i != std::string::npos)
						{
							last = first.substr(i + 1);
							first = first.substr(0, i);
						}
						else
						{
							last = "";
						}
					}
				}
				args["FIRST_NAME"] = first;
				args["LAST_NAME"] = last;	
			}
			if (command == GRANT)
			{
				LLNotifications::instance().add("GrantModifyRights", 
					args, 
					LLSD(), 
					boost::bind(&LLPanelFriends::modifyRightsConfirmation, this, _1, _2, rights));
			}
			else
			{
				LLNotifications::instance().add("RevokeModifyRights", 
					args, 
					LLSD(), 
					boost::bind(&LLPanelFriends::modifyRightsConfirmation, this, _1, _2, rights));
			}
		}
		else
		{
			if (command == GRANT)
			{
				LLNotifications::instance().add("GrantModifyRightsMultiple", 
					args, 
					LLSD(), 
					boost::bind(&LLPanelFriends::modifyRightsConfirmation, this, _1, _2, rights));
			}
			else
			{
				LLNotifications::instance().add("RevokeModifyRightsMultiple", 
					args, 
					LLSD(), 
					boost::bind(&LLPanelFriends::modifyRightsConfirmation, this, _1, _2, rights));
			}
		}
	}
}
开发者ID:Krazy-Bish-Margie,项目名称:Sausages,代码行数:72,代码来源:llfloaterfriends.cpp


示例6: rights_map_t

void LLPanelFriends::confirmModifyRights(rights_map_t& ids, EGrantRevoke command)
{
	if (ids.empty()) return;
	
	LLSD args;
	if(ids.size() > 0)
	{
		rights_map_t* rights = new rights_map_t(ids);

		// for single friend, show their name
		if(ids.size() == 1)
		{
			LLUUID agent_id = ids.begin()->first;
			//std::string first, last;
			//if(gCacheName->getName(agent_id, first, last))
			//{
			//	args["FIRST_NAME"] = first;
			//	args["LAST_NAME"] = last;	
			//}

			LLAvatarName avatar_name;
			if (LLAvatarNameCache::get(agent_id, &avatar_name))
			{
				std::string fullname;
				static const LLCachedControl<S32> phoenix_name_system("PhoenixNameSystem", 0);
				switch (phoenix_name_system)
				{
					case 0 : fullname = avatar_name.getLegacyName(); break;
					case 1 : fullname = (avatar_name.mIsDisplayNameDefault ? avatar_name.mDisplayName : avatar_name.getCompleteName()); break;
					case 2 : fullname = avatar_name.mDisplayName; break;
					default : fullname = avatar_name.getCompleteName(); break;
				}
				
				args["NAME"] = fullname;
			}

			if (command == GRANT)
			{
				LLNotifications::instance().add("GrantModifyRights", 
					args, 
					LLSD(), 
					boost::bind(&LLPanelFriends::modifyRightsConfirmation, this, _1, _2, rights));
			}
			else
			{
				LLNotifications::instance().add("RevokeModifyRights", 
					args, 
					LLSD(), 
					boost::bind(&LLPanelFriends::modifyRightsConfirmation, this, _1, _2, rights));
			}
		}
		else
		{
			if (command == GRANT)
			{
				LLNotifications::instance().add("GrantModifyRightsMultiple", 
					args, 
					LLSD(), 
					boost::bind(&LLPanelFriends::modifyRightsConfirmation, this, _1, _2, rights));
			}
			else
			{
				LLNotifications::instance().add("RevokeModifyRightsMultiple", 
					args, 
					LLSD(), 
					boost::bind(&LLPanelFriends::modifyRightsConfirmation, this, _1, _2, rights));
			}
		}
	}
}
开发者ID:Kiera,项目名称:Crow,代码行数:70,代码来源:llfloaterfriends.cpp



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C++ ring_elem类代码示例发布时间:2022-05-31
下一篇:
C++ reverse_iterator类代码示例发布时间:2022-05-31
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap