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


C++ LLSD::endArray方法代码示例

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


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

示例1: parseSimulatorFeatures

void LLMuteList::parseSimulatorFeatures()
{
	LLViewerRegion* regionp = gAgent.getRegion();
	if (!regionp) return;

	LLSD info;
	regionp->getSimulatorFeatures(info);

	mGodLastNames.clear();
	mGodFullNames.clear();

	if (info.has("god_names"))
	{
		if (info["god_names"].has("last_names"))
		{
			LLSD godNames = info["god_names"]["last_names"];

			for (LLSD::array_iterator godNames_it = godNames.beginArray(); godNames_it != godNames.endArray(); ++godNames_it)
				mGodLastNames.insert((*godNames_it).asString());
		}

		if (info["god_names"].has("full_names"))
		{
			LLSD godNames = info["god_names"]["full_names"];

			for (LLSD::array_iterator godNames_it = godNames.beginArray(); godNames_it != godNames.endArray(); ++godNames_it)
				mGodFullNames.insert((*godNames_it).asString());
		}
	}
	else // Just use Linden
	{
		mGodLastNames.insert("Linden");
	}
}
开发者ID:ArxNet,项目名称:SingularityViewer,代码行数:34,代码来源:llmutelist.cpp

示例2: parseData

void HippoGridManager::parseData(LLSD &gridInfo, bool mergeIfNewer)
{
	if (mergeIfNewer) {
		LLSD::array_const_iterator it, end = gridInfo.endArray();
		for (it = gridInfo.beginArray(); it != end; ++it) {
			LLSD gridMap = *it;
			if (gridMap.has("default_grids_version")) {
				int version = gridMap["default_grids_version"];
				if (version <= mDefaultGridsVersion) return;
				else break;
			}
		}
		if (it == end) {
			llwarns << "Grid data has no version number." << llendl;
			return;
		}
	}

	llinfos << "Loading grid data." << llendl;

	LLSD::array_const_iterator it, end = gridInfo.endArray();
	for (it = gridInfo.beginArray(); it != end; ++it) {
		LLSD gridMap = *it;
		if (gridMap.has("default_grids_version")) {
			mDefaultGridsVersion = gridMap["default_grids_version"];
		} else if (gridMap.has("gridnick") && gridMap.has("loginuri")) {
			std::string gridnick = gridMap["gridnick"];
			HippoGridInfo *grid;
			GridIterator it = mGridInfo.find(gridnick);
			bool newGrid = (it == mGridInfo.end());
			if (newGrid) {
				// create new grid info
				grid = new HippoGridInfo(gridnick);
			} else {
				// update existing grid info
				grid = it->second;
			}
			grid->setLoginUri(gridMap["loginuri"]);
			if (gridMap.has("platform")) grid->setPlatform(gridMap["platform"]);
			if (gridMap.has("gridname")) grid->setGridName(gridMap["gridname"]);
			if (gridMap.has("loginpage")) grid->setLoginPage(gridMap["loginpage"]);
			if (gridMap.has("helperuri")) grid->setHelperUri(gridMap["helperuri"]);
			if (gridMap.has("website")) grid->setWebSite(gridMap["website"]);
			if (gridMap.has("support")) grid->setSupportUrl(gridMap["support"]);
			if (gridMap.has("register")) grid->setRegisterUrl(gridMap["register"]);
			if (gridMap.has("password")) grid->setPasswordUrl(gridMap["password"]);
			//if (gridMap.has("search")) grid->setSearchUrl(gridMap["search"]);
			if (gridMap.has("render_compat")) grid->setRenderCompat(gridMap["render_compat"]);
			if (gridMap.has("firstname")) grid->setFirstName(gridMap["firstname"]);
			if (gridMap.has("lastname")) grid->setLastName(gridMap["lastname"]);
			if (gridMap.has("avatarpassword")) grid->setAvatarPassword(gridMap["avatarpassword"]);
			if (newGrid) addGrid(grid);
		}
	}
}
开发者ID:AGoodPerson,项目名称:Ascent,代码行数:55,代码来源:hippogridmanager.cpp

示例3: updateSuggestedFriendList

bool LLFacebookFriendsPanel::updateSuggestedFriendList()
{
	const LLAvatarTracker& av_tracker = LLAvatarTracker::instance();
	uuid_vec_t& second_life_friends = mSecondLifeFriends->getIDs();
	second_life_friends.clear();
	uuid_vec_t& suggested_friends = mSuggestedFriends->getIDs();
	suggested_friends.clear();

	//Add suggested friends
	LLSD friends = LLFacebookConnect::instance().getContent();
	for (LLSD::array_const_iterator i = friends.beginArray(); i != friends.endArray(); ++i)
	{
		LLUUID agent_id = (*i).asUUID();
		if (agent_id.notNull())
		{
			bool second_life_buddy = av_tracker.isBuddy(agent_id);
			if (second_life_buddy)
			{
				second_life_friends.push_back(agent_id);
			}
			else
			{
				//FB+SL but not SL friend
				suggested_friends.push_back(agent_id);
			}
		}
	}

	//Force a refresh when there aren't any filter matches (prevent displaying content that shouldn't display)
	mSecondLifeFriends->setDirty(true, !mSecondLifeFriends->filterHasMatches());
	mSuggestedFriends->setDirty(true, !mSuggestedFriends->filterHasMatches());
	showFriendsAccordionsIfNeeded();

	return false;
}
开发者ID:CaseyraeStarfinder,项目名称:Firestorm-Viewer,代码行数:35,代码来源:llfloaterfacebook.cpp

示例4: configure

	void configure(const LLSD& config)
	{
		AIAccess<Settings> settings_w(Settings::get());
		AIAccess<Globals>(Globals::get())->invalidateCallSites();
		settings_w->functionLevelMap.clear();
		settings_w->classLevelMap.clear();
		settings_w->fileLevelMap.clear();
		settings_w->tagLevelMap.clear();
		settings_w->uniqueLogMessages.clear();
		
		setPrintLocation(settings_w, config["print-location"]);
		setDefaultLevel(settings_w, decodeLevel(config["default-level"]));
		
		LLSD sets = config["settings"];
		LLSD::array_const_iterator a, end;
		for (a = sets.beginArray(), end = sets.endArray(); a != end; ++a)
		{
			const LLSD& entry = *a;
			
			ELevel level = decodeLevel(entry["level"]);
			
			setLevels(settings_w->functionLevelMap, entry["functions"], level);
			setLevels(settings_w->classLevelMap,	 entry["classes"],   level);
			setLevels(settings_w->fileLevelMap,	 entry["files"],	 level);
			setLevels(settings_w->tagLevelMap,		 entry["tags"],		 level);
		}
	}
开发者ID:arsenico,项目名称:SingularityViewer,代码行数:27,代码来源:llerror.cpp

示例5: getContent

		/*virtual*/ void httpCompleted()
		{
			LLSD experiences = getContent()["experience_keys"];
			LLSD::array_const_iterator it = experiences.beginArray();
			for( /**/ ; it != experiences.endArray(); ++it)
			{
				const LLSD& row = *it;
				LLUUID public_key = row[EXPERIENCE_ID].asUUID();


				LL_DEBUGS("ExperienceCache") << "Received result for " << public_key 
					<< " display '" << row[LLExperienceCache::NAME].asString() << "'" << LL_ENDL ;

				processExperience(public_key, row);
			}

			LLSD error_ids = getContent()["error_ids"];
			LLSD::array_const_iterator errIt = error_ids.beginArray();
			for( /**/ ; errIt != error_ids.endArray() ; ++errIt )
			{
				LLUUID id = errIt->asUUID();		
				LLSD exp;
				exp[EXPIRES]=DEFAULT_EXPIRATION;
				exp[EXPERIENCE_ID] = id;
				exp[PROPERTIES]=PROPERTY_INVALID;
				exp[MISSING]=true;
                exp[QUOTA] = DEFAULT_QUOTA;

				processExperience(id, exp);
				LL_WARNS("ExperienceCache") << "LLExperienceResponder::result() error result for " << id << LL_ENDL ;
			}

			LL_DEBUGS("ExperienceCache") << sCache.size() << " cached experiences" << LL_ENDL;
		}
开发者ID:Belxjander,项目名称:Kirito,代码行数:34,代码来源:llexperiencecache.cpp

示例6: doPrefetchImages

void LLViewerImageList::doPrefetchImages()
{
#if 1
    if (LLAppViewer::instance()->getPurgeCache())
	{
		// cache was purged, no point
		return;
	}
	
	// Pre-fetch textures from last logout
	LLSD imagelist;
	std::string filename = gDirUtilp->getExpandedFilename(LL_PATH_PER_SL_ACCOUNT, get_texture_list_name());
	llifstream file;
	file.open(filename);
	if (file.is_open())
	{
		LLSDSerialize::fromXML(imagelist, file);
	}
	for (LLSD::array_iterator iter = imagelist.beginArray();
		 iter != imagelist.endArray(); ++iter)
	{
		LLSD imagesd = *iter;
		LLUUID uuid = imagesd["uuid"];
		S32 pixel_area = imagesd["area"];
		LLViewerImage* image = getImage(uuid, MIPMAP_TRUE, FALSE);
		if (image)
		{
			image->addTextureStats((F32)pixel_area);
		}
	}
#endif
	
}
开发者ID:Avian-IW,项目名称:InWorldz-Viewer,代码行数:33,代码来源:llviewerimagelist.cpp

示例7: receivePluginMessage

// This function is called when a new message is received from the plugin.
// We get here when calling mPluginManager->update() in the first line of
// AIFilePicker::multiplex_impl.
//
// Note that we can't call finish() or abort() directly in this function,
// as that deletes mPluginManager and we're using the plugin manager
// right now (to receive this message)!
void AIFilePicker::receivePluginMessage(const LLPluginMessage &message)
{
	std::string message_class = message.getClass();

	if (message_class == LLPLUGIN_MESSAGE_CLASS_BASIC)
	{
		std::string message_name = message.getName();
		if (message_name == "canceled")
		{
			LL_DEBUGS("Plugin") << "received message \"canceled\"" << LL_ENDL;
			set_state(AIFilePicker_canceled);
		}
		else if (message_name == "done")
		{
			LL_DEBUGS("Plugin") << "received message \"done\"" << LL_ENDL;
			LLSD filenames = message.getValueLLSD("filenames");
			mFilenames.clear();
			for(LLSD::array_iterator filename = filenames.beginArray(); filename != filenames.endArray(); ++filename)
			{
				mFilenames.push_back(*filename);
			}
			set_state(AIFilePicker_done);
		}
		else
		{
			LL_WARNS("Plugin") << "Unknown " << message_class << " class message: " << message_name << LL_ENDL;
		}
	}
}
开发者ID:cry0,项目名称:SingularityViewer,代码行数:36,代码来源:aifilepicker.cpp

示例8: return

bool LLNotificationsListener::Forwarder::matchType(const LLSD& filter, const std::string& type) const
{
    // Decide whether this notification matches filter:
    // undefined: forward all notifications
    if (filter.isUndefined())
    {
        return true;
    }
    // array of string: forward any notification matching any named type
    if (filter.isArray())
    {
        for (LLSD::array_const_iterator ti(filter.beginArray()), tend(filter.endArray());
             ti != tend; ++ti)
        {
            if (ti->asString() == type)
            {
                return true;
            }
        }
        // Didn't match any entry in the array
        return false;
    }
    // string: forward only the specific named type
    return (filter.asString() == type);
}
开发者ID:Katharine,项目名称:kittyviewer,代码行数:25,代码来源:llnotificationslistener.cpp

示例9: addObjectToScrollList

void LLFloaterPathfindingObjects::addObjectToScrollList(const LLPathfindingObjectPtr pObjectPtr, const LLSD &pScrollListItemData)
{
	LLScrollListCell::Params cellParams;
	//cellParams.font = LLFontGL::getFontSansSerif();

	LLScrollListItem::Params rowParams;
	rowParams.value = pObjectPtr->getUUID().asString();

	llassert(pScrollListItemData.isArray());
	for (LLSD::array_const_iterator cellIter = pScrollListItemData.beginArray();
		cellIter != pScrollListItemData.endArray(); ++cellIter)
	{
		const LLSD &cellElement = *cellIter;

		llassert(cellElement.has("column"));
		llassert(cellElement.get("column").isString());
		cellParams.column = cellElement.get("column").asString();

		llassert(cellElement.has("value"));
		llassert(cellElement.get("value").isString());
		cellParams.value = cellElement.get("value").asString();

		rowParams.columns.add(cellParams);
	}

	LLScrollListItem *scrollListItem = mObjectsScrollList->addRow(rowParams);

	if (pObjectPtr->hasOwner() && !pObjectPtr->hasOwnerName())
	{
		mMissingNameObjectsScrollListItems.insert(std::make_pair(pObjectPtr->getUUID().asString(), scrollListItem));
		pObjectPtr->registerOwnerNameListener(boost::bind(&LLFloaterPathfindingObjects::handleObjectNameResponse, this, _1));
	}
}
开发者ID:1234-,项目名称:SingularityViewer,代码行数:33,代码来源:llfloaterpathfindingobjects.cpp

示例10: configure

	void configure(const LLSD& config)
	{
		Globals& g = Globals::get();
		Settings& s = Settings::get();
		
		g.invalidateCallSites();
		s.functionLevelMap.clear();
		s.classLevelMap.clear();
		s.fileLevelMap.clear();
		
		setPrintLocation(config["print-location"]);
		setDefaultLevel(decodeLevel(config["default-level"]));
		
		LLSD sets = config["settings"];
		LLSD::array_const_iterator a, end;
		for (a = sets.beginArray(), end = sets.endArray(); a != end; ++a)
		{
			const LLSD& entry = *a;
			
			ELevel level = decodeLevel(entry["level"]);
			
			setLevels(s.functionLevelMap,	entry["functions"],	level);
			setLevels(s.classLevelMap,		entry["classes"],	level);
			setLevels(s.fileLevelMap,		entry["files"],		level);
		}
	}
开发者ID:Boy,项目名称:netbook,代码行数:26,代码来源:llerror.cpp

示例11: handleCopyProtectedItem

// static
bool LLGiveInventory::handleCopyProtectedItem(const LLSD& notification, const LLSD& response)
{
	S32 option = LLNotificationsUtil::getSelectedOption(notification, response);
	LLSD itmes = notification["payload"]["items"];
	LLInventoryItem* item = NULL;
	switch(option)
	{
	case 0:  // "Yes"
		for (LLSD::array_iterator it = itmes.beginArray(); it != itmes.endArray(); it++)
		{
			item = gInventory.getItem((*it).asUUID());
			if (item)
			{
				LLGiveInventory::commitGiveInventoryItem(notification["payload"]["agent_id"].asUUID(),
					item);
				// delete it for now - it will be deleted on the server
				// quickly enough.
				gInventory.deleteObject(item->getUUID());
				gInventory.notifyObservers();
			}
			else
			{
				LLNotificationsUtil::add("CannotGiveItem");
			}
		}
		break;

	default: // no, cancel, whatever, who cares, not yes.
		LLNotificationsUtil::add("TransactionCancelled");
		break;
	}
	return false;
}
开发者ID:IamusNavarathna,项目名称:SingularityViewer,代码行数:34,代码来源:llgiveinventory.cpp

示例12: doPrefetchImages

void LLViewerTextureList::doPrefetchImages()
{
	if (LLAppViewer::instance()->getPurgeCache())
	{
		// cache was purged, no point
		return;
	}
	
	// Pre-fetch textures from last logout
	LLSD imagelist;
	std::string filename = gDirUtilp->getExpandedFilename(LL_PATH_PER_SL_ACCOUNT, get_texture_list_name());
	llifstream file;
	file.open(filename);
	if (file.is_open())
	{
		LLSDSerialize::fromXML(imagelist, file);
	}
	for (LLSD::array_iterator iter = imagelist.beginArray();
		 iter != imagelist.endArray(); ++iter)
	{
		LLSD imagesd = *iter;
		LLUUID uuid = imagesd["uuid"];
		S32 pixel_area = imagesd["area"];
		S32 texture_type = imagesd["type"];

		if(LLViewerTexture::FETCHED_TEXTURE == texture_type || LLViewerTexture::LOD_TEXTURE == texture_type)
		{
			LLViewerFetchedTexture* image = LLViewerTextureManager::getFetchedTexture(uuid, MIPMAP_TRUE, LLViewerTexture::BOOST_NONE, texture_type);
			if (image)
			{
				image->addTextureStats((F32)pixel_area);
			}
		}
	}
}
开发者ID:Barosonix,项目名称:AstraViewer,代码行数:35,代码来源:llviewertexturelist.cpp

示例13:

	/*virtual*/ void result(const LLSD& content)
	{
		// Pull expiration out of headers if available
		F64 expires = LLAvatarNameCache::nameExpirationFromHeaders(mHeaders);
		F64 now = LLFrameTimer::getTotalSeconds();

		LLSD agents = content["agents"];
		LLSD::array_const_iterator it = agents.beginArray();
		for ( ; it != agents.endArray(); ++it)
		{
			const LLSD& row = *it;
			LLUUID agent_id = row["id"].asUUID();

			LLAvatarName av_name;
			av_name.fromLLSD(row);

			// Use expiration time from header
			av_name.mExpires = expires;

			// Some avatars don't have explicit display names set
			if (av_name.mDisplayName.empty())
			{
				av_name.mDisplayName = av_name.mUsername;
			}

			LL_DEBUGS("AvNameCache") << "LLAvatarNameResponder::result for " << agent_id << " "
									 << "user '" << av_name.mUsername << "' "
									 << "display '" << av_name.mDisplayName << "' "
									 << "expires in " << expires - now << " seconds"
									 << LL_ENDL;
			
			// cache it and fire signals
			LLAvatarNameCache::processName(agent_id, av_name, true);
		}

		// Same logic as error response case
		LLSD unresolved_agents = content["bad_ids"];
		S32  num_unresolved = unresolved_agents.size();
		if (num_unresolved > 0)
		{
            LL_WARNS("AvNameCache") << "LLAvatarNameResponder::result " << num_unresolved << " unresolved ids; "
                                    << "expires in " << expires - now << " seconds"
                                    << LL_ENDL;
			it = unresolved_agents.beginArray();
			for ( ; it != unresolved_agents.endArray(); ++it)
			{
				const LLUUID& agent_id = *it;

				LL_WARNS("AvNameCache") << "LLAvatarNameResponder::result "
                                        << "failed id " << agent_id
                                        << LL_ENDL;

                LLAvatarNameCache::handleAgentError(agent_id);
			}
		}
        LL_DEBUGS("AvNameCache") << "LLAvatarNameResponder::result " 
                                 << LLAvatarNameCache::sCache.size() << " cached names"
                                 << LL_ENDL;
    }
开发者ID:wish-ds,项目名称:firestorm-ds,代码行数:59,代码来源:llavatarnamecache.cpp

示例14:

	/*virtual*/ void result(const LLSD& content)
	{
		// Pull expiration out of headers if available
		F64 expires = LLAvatarNameCache::nameExpirationFromHeaders(mHeaders);

		LLSD agents = content["agents"];
		LLSD::array_const_iterator it = agents.beginArray();
		for ( ; it != agents.endArray(); ++it)
		{
			const LLSD& row = *it;
			LLUUID agent_id = row["id"].asUUID();

			LLAvatarName av_name;
			av_name.fromLLSD(row);

			// Use expiration time from header
			av_name.mExpires = expires;

			// Some avatars don't have explicit display names set
			if (av_name.mDisplayName.empty())
			{
				av_name.mDisplayName = av_name.mUsername;
			}

			// cache it and fire signals
			LLAvatarNameCache::processName(agent_id, av_name, true);
		}

		// Same logic as error response case
		LLSD unresolved_agents = content["bad_ids"];
		if (unresolved_agents.size() > 0)
		{
			const std::string DUMMY_NAME("\?\?\?");
			LLAvatarName av_name;
			av_name.mUsername = DUMMY_NAME;
			av_name.mDisplayName = DUMMY_NAME;
			av_name.mIsDisplayNameDefault = false;
			av_name.mIsDummy = true;
			av_name.mExpires = expires;

			it = unresolved_agents.beginArray();
			for ( ; it != unresolved_agents.endArray(); ++it)
			{
				const LLUUID& agent_id = *it;
				// cache it and fire signals

				// Wolfspirit: Do not use ???  as username. Try to get a username out of the old legacy name
				std::string oldname;
				gCacheName->getFullName(agent_id, oldname);		
				LLStringUtil::toLower(oldname);
				LLStringUtil::replaceString(oldname," ",".");	
				LLStringUtil::replaceString(oldname,".resident","");	
				av_name.mUsername = oldname;

				LLAvatarNameCache::processName(agent_id, av_name, true);
			}
		}
	}
开发者ID:BillBarnhill,项目名称:SingularityViewer,代码行数:58,代码来源:llavatarnamecache.cpp

示例15:

LLSavedLogins::LLSavedLogins(const LLSD& history_data)
{
	if (!history_data.isArray()) throw std::invalid_argument("Invalid history data.");
	for (LLSD::array_const_iterator i = history_data.beginArray();
		 i != history_data.endArray(); ++i)
	{
	  	// Put the last used grids first.
		if (!i->isUndefined()) mEntries.push_front(LLSavedLoginEntry(*i));
	}
}
开发者ID:AGoodPerson,项目名称:Ascent,代码行数:10,代码来源:llsavedlogins.cpp


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