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


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

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


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

示例1: mapToQueryString

std::string LLURI::mapToQueryString(const LLSD& queryMap)
{
    std::string query_string;
    if (queryMap.isMap())
    {
        bool first_element = true;
        LLSD::map_const_iterator iter = queryMap.beginMap();
        LLSD::map_const_iterator end = queryMap.endMap();
        std::ostringstream ostr;
        for (; iter != end; ++iter)
        {
            if(first_element)
            {
                ostr << "?";
                first_element = false;
            }
            else
            {
                ostr << "&";
            }
            ostr << ::escapeQueryVariable(iter->first);
            if(iter->second.isDefined())
            {
                ostr << "=" <<  ::escapeQueryValue(iter->second.asString());
            }
        }
        query_string = ostr.str();
    }
    return query_string;
}
开发者ID:CaseyraeStarfinder,项目名称:Firestorm-Viewer,代码行数:30,代码来源:lluri.cpp

示例2: find

//  Find a certificate in the list.
// It will find a cert that has minimally the params listed, with the values being the same
LLBasicCertificateVector::iterator LLBasicCertificateVector::find(const LLSD& params)
{
	BOOL found = FALSE;
	// loop through the entire vector comparing the values in the certs
	// against those passed in via the params.
	// params should be a map.  Only the items specified in the map will be
	// checked, but they must match exactly, even if they're maps or arrays.
	
	for(iterator cert = begin();
		cert != end();
		cert++)
	{

		found= TRUE;
		LLSD cert_info;
		(*cert)->getLLSD(cert_info);
			for (LLSD::map_const_iterator param = params.beginMap();
			 param != params.endMap();
			 param++)
		{

			if (!cert_info.has((std::string)param->first) || 
				(!valueCompareLLSD(cert_info[(std::string)param->first], param->second)))
			{
				found = FALSE;
				break;
			}
		}
		if (found)
		{
			return (cert);
		}
	}
	return end();
}
开发者ID:HyangZhao,项目名称:NaCl-main,代码行数:37,代码来源:llsechandler_basic.cpp

示例3: importFile

void LLAvatarNameCache::importFile(std::istream& istr)
{
	LLSD data;
	S32 parse_count = LLSDSerialize::fromXMLDocument(data, istr);
	if (parse_count < 1) return;

	// by convention LLSD storage is a map
	// we only store one entry in the map
	LLSD agents = data["agents"];

	LLUUID agent_id;
	LLAvatarName av_name;
	LLSD::map_const_iterator it = agents.beginMap();
	for ( ; it != agents.endMap(); ++it)
	{
		agent_id.set(it->first);
		av_name.fromLLSD( it->second );
		sCache[agent_id] = av_name;
	}
    LL_INFOS("AvNameCache") << "loaded " << sCache.size() << LL_ENDL;

	// Some entries may have expired since the cache was stored,
    // but they will be flushed in the first call to eraseUnrefreshed
    // from LLAvatarNameResponder::idle
}
开发者ID:Thunderstorm,项目名称:Thunderstorm,代码行数:25,代码来源:llavatarnamecache.cpp

示例4: loadFile

// static
bool AIFilePicker::loadFile(std::string const& filename)
{
	LLSD data;
	std::string filepath = gDirUtilp->getExpandedFilename(LL_PATH_USER_SETTINGS, filename);
	llifstream file(filepath);
	if (file.is_open())
	{
		LL_INFOS() << "Loading filepicker context file at \"" << filepath << "\"." << LL_ENDL;
		LLSDSerialize::fromXML(data, file);
	}

	if (!data.isMap())
	{
		LL_INFOS() << "File missing, ill-formed, or simply undefined; not changing the file (" << filepath << ")." << LL_ENDL;
		return false;
	}

	AIAccess<context_map_type> wContextMap(sContextMap);

	for (LLSD::map_const_iterator iter = data.beginMap(); iter != data.endMap(); ++iter)
	{
		wContextMap->insert(context_map_type::value_type(iter->first, iter->second.asString()));
	}

	return true;
}
开发者ID:GODOFMINECRAFT4,项目名称:SingularityViewer,代码行数:27,代码来源:aifilepicker.cpp

示例5: haveValuesChanged

//private
bool LLFloaterMediaSettings::haveValuesChanged() const
{
	bool values_changed = false;
	// *NOTE: The code below is very inefficient.  Better to do this
	// only when data change.
	// Every frame, check to see what the values are.  If they are not
	// the same as the initial media data, enable the OK/Apply buttons
	LLSD settings;
	sInstance->mPanelMediaSettingsGeneral->getValues( settings );
	sInstance->mPanelMediaSettingsSecurity->getValues( settings );
	sInstance->mPanelMediaSettingsPermissions->getValues( settings );	
	LLSD::map_const_iterator iter = settings.beginMap();
	LLSD::map_const_iterator end = settings.endMap();
	for ( ; iter != end; ++iter )
	{
		const std::string &current_key = iter->first;
		const LLSD &current_value = iter->second;
		if ( ! llsd_equals(current_value, mInitialValues[current_key]))
		{
			values_changed = true;
			break;
		}
	}
	return values_changed;
}
开发者ID:OS-Development,项目名称:VW.Zen,代码行数:26,代码来源:llfloatermediasettings.cpp

示例6: msblacklist

void PhoenixViewerLink::msblacklist(U32 status,std::string body)
{
	if(status != 200)
	{
		LL_WARNS("Blacklist") << "Something went wrong with the blacklist download status code " << status << LL_ENDL;
	}

	std::istringstream istr(body);
	if (body.size() > 0)
	{
		LLSD data;
		if(LLSDSerialize::fromXML(data,istr) >= 1)
		{
			LL_INFOS("Blacklist") << body.size() << " bytes received, updating local blacklist" << LL_ENDL;
			for(LLSD::map_iterator itr = data.beginMap(); itr != data.endMap(); ++itr)
			{
				if(itr->second.has("name"))
					LLFloaterBlacklist::addEntry(LLUUID(itr->first),itr->second);
			}
		}
		else
		{
			LL_INFOS("Blacklist") << "Failed to parse blacklist.xml" << LL_ENDL;
		}
	}
	else
	{
		LL_INFOS("Blacklist") << "Empty blacklist.xml" << LL_ENDL;
	}
}
开发者ID:Xara,项目名称:phoenix-sg,代码行数:30,代码来源:a_phoenixviewerlink.cpp

示例7: llformat

LLImportWearable::LLImportWearable(LLSD sd)
{
	mOrginalLLSD = sd;
	mName = sd["name"].asString();
	mType = sd["wearabletype"].asInteger();

	LLSD params = sd["params"];
	LLSD textures = sd["textures"];

	mData = "LLWearable version 22\n" + 
			mName + "\n\n" + 
			"\tpermissions 0\n" + 
			"\t{\n" + 
			"\t\tbase_mask\t7fffffff\n" + 
			"\t\towner_mask\t7fffffff\n" + 
			"\t\tgroup_mask\t00000000\n" + 
			"\t\teveryone_mask\t00000000\n" + 
			"\t\tnext_owner_mask\t00082000\n" + 
			"\t\tcreator_id\t00000000-0000-0000-0000-000000000000\n" + 
			"\t\towner_id\t" + gAgent.getID().asString() + "\n" + 
			"\t\tlast_owner_id\t" + gAgent.getID().asString() + "\n" + 
			"\t\tgroup_id\t00000000-0000-0000-0000-000000000000\n" + 
			"\t}\n" + 
			"\tsale_info\t0\n" + 
			"\t{\n" + 
			"\t\tsale_type\tnot\n" + 
			"\t\tsale_price\t10\n" + 
			"\t}\n" + 
			"type " + llformat("%d", mType) + "\n";

	mData += llformat("parameters %d\n", params.size());
	LLSD::map_iterator map_iter = params.beginMap();
	LLSD::map_iterator map_end = params.endMap();
	for( ; map_iter != map_end; ++map_iter)
	{
		mData += (*map_iter).first + " " + terse_F32_string((*map_iter).second.asReal()) + "\n";
	}

	mData += llformat("textures %d\n", textures.size());
	map_iter = textures.beginMap();
	map_end = textures.endMap();
	for( ; map_iter != map_end; ++map_iter)
	{
		mTextures.push_back((*map_iter).second);
		mData += (*map_iter).first + " " + (*map_iter).second.asString() + "\n";
	}
}
开发者ID:,项目名称:,代码行数:47,代码来源:

示例8: addAllSkies

void LLWLParamManager::addAllSkies(const LLWLParamKey::EScope scope, const LLSD& sky_presets)
{
	for(LLSD::map_const_iterator iter = sky_presets.beginMap(); iter != sky_presets.endMap(); ++iter)
	{
		LLWLParamSet set;
		set.setAll(iter->second);
		mParamList[LLWLParamKey(iter->first, scope)] = set;
	}
}
开发者ID:AlericInglewood,项目名称:SingularityViewer,代码行数:9,代码来源:llwlparammanager.cpp

示例9: mergeLogs

void LLCrashLogger::mergeLogs( LLSD src_sd )
{
    LLSD::map_iterator iter = src_sd.beginMap();
	LLSD::map_iterator end = src_sd.endMap();
	for( ; iter != end; ++iter)
    {
        mDebugLog[iter->first] = iter->second;
    }
}
开发者ID:1234-,项目名称:SingularityViewer,代码行数:9,代码来源:llcrashlogger.cpp

示例10: setArgs

void LLUIString::setArgs(const LLSD& sd)
{
	if (!sd.isMap()) return;
	for(LLSD::map_const_iterator sd_it = sd.beginMap();
		sd_it != sd.endMap();
		++sd_it)
	{
		setArg(sd_it->first, sd_it->second.asString());
	}
	format();
}
开发者ID:9skunks,项目名称:imprudence,代码行数:11,代码来源:lluistring.cpp

示例11: process_impl

// virtual
LLIOPipe::EStatus LLHTTPResponseHeader::process_impl(
	const LLChannelDescriptors& channels,
	buffer_ptr_t& buffer,
	bool& eos,
	LLSD& context,
	LLPumpIO* pump)
{
	PUMP_DEBUG;
	LLMemType m1(LLMemType::MTYPE_IO_HTTP_SERVER);
	if(eos)
	{
		PUMP_DEBUG;
		//mGotEOS = true;
		std::ostringstream ostr;
		std::string message = context[CONTEXT_RESPONSE]["statusMessage"];
		
		int code = context[CONTEXT_RESPONSE]["statusCode"];
		if (code < 200)
		{
			code = 200;
			message = "OK";
		}
		
		ostr << HTTP_VERSION_STR << " " << code << " " << message << "\r\n";
		S32 content_length = buffer->countAfter(channels.in(), NULL);
		if(0 < content_length)
		{
			ostr << "Content-Length: " << content_length << "\r\n";
		}
		// *NOTE: This guard can go away once the LLSD static map
		// iterator is available. Phoenix. 2008-05-09
		LLSD headers = context[CONTEXT_RESPONSE][CONTEXT_HEADERS];
		if(headers.isDefined())
		{
			LLSD::map_iterator iter = headers.beginMap();
			LLSD::map_iterator end = headers.endMap();
			for(; iter != end; ++iter)
			{
				ostr << (*iter).first << ": " << (*iter).second.asString()
					<< "\r\n";
			}
		}
		ostr << "\r\n";

		LLChangeChannel change(channels.in(), channels.out());
		std::for_each(buffer->beginSegment(), buffer->endSegment(), change);
		std::string header = ostr.str();
		buffer->prepend(channels.out(), (U8*)header.c_str(), header.size());
		PUMP_DEBUG;
		return STATUS_DONE;
	}
	PUMP_DEBUG;
	return STATUS_OK;
}
开发者ID:Nora28,项目名称:imprudence,代码行数:55,代码来源:lliohttpserver.cpp

示例12: loadConfig

void GrowlManager::loadConfig()
{
	std::string config_file = gDirUtilp->getExpandedFilename(LL_PATH_APP_SETTINGS, "growl_notifications.xml");
	if(config_file == "")
	{
		LL_WARNS("GrowlConfig") << "Couldn't find growl_notifications.xml" << LL_ENDL;
		return;
	}
	LL_INFOS("GrowlConfig") << "Loading growl notification config from " << config_file << LL_ENDL;
	llifstream configs(config_file);
	LLSD notificationLLSD;
	std::set<std::string> notificationTypes;
	notificationTypes.insert("Keyword Alert");
	notificationTypes.insert("Instant Message received");
	if(configs.is_open())
	{
		LLSDSerialize::fromXML(notificationLLSD, configs);
		for(LLSD::map_iterator itr = notificationLLSD.beginMap(); itr != notificationLLSD.endMap(); ++itr)
		{
			GrowlNotification ntype;
			ntype.growlName = itr->second.get("GrowlName").asString();
			notificationTypes.insert(ntype.growlName);
			
			if(itr->second.has("GrowlTitle"))
				ntype.growlTitle = itr->second.get("GrowlTitle").asString();			
			if(itr->second.has("GrowlBody"))
				ntype.growlBody = itr->second.get("GrowlBody").asString();
			if(itr->second.has("UseDefaultTextForTitle"))
				ntype.useDefaultTextForTitle = itr->second.get("UseDefaultTextForTitle").asBoolean();
			else
				ntype.useDefaultTextForTitle = false;
			if(itr->second.has("UseDefaultTextForBody"))
				ntype.useDefaultTextForBody = itr->second.get("UseDefaultTextForBody").asBoolean();
			else
				ntype.useDefaultTextForBody = false;
			if(ntype.useDefaultTextForBody == false && ntype.useDefaultTextForTitle == false && 
			   ntype.growlBody == "" && ntype.growlTitle == "")
			{
				ntype.useDefaultTextForBody = true;
			}
			this->mNotifications[itr->first] = ntype;
		}
		configs.close();

		this->mNotifier->registerApplication("Ascent Viewer", notificationTypes);
	}
	else
	{
		LL_WARNS("GrowlConfig") << "Couldn't open growl config file." << LL_ENDL;
	}

}
开发者ID:N3X15,项目名称:Luna-Viewer,代码行数:52,代码来源:growlmanager.cpp

示例13: setArgs

void LLUIString::setArgs(const LLSD& sd)
{
	LLFastTimer timer(FTM_UI_STRING);
	
	if (!sd.isMap()) return;
	for(LLSD::map_const_iterator sd_it = sd.beginMap();
		sd_it != sd.endMap();
		++sd_it)
	{
		setArg(sd_it->first, sd_it->second.asString());
	}
	dirty();
}
开发者ID:jimjesus,项目名称:kittyviewer,代码行数:13,代码来源:lluistring.cpp

示例14: parseCharacterListData

void LLPathfindingCharacterList::parseCharacterListData(const LLSD& pCharacterListData)
{
	LLPathfindingObjectMap &objectMap = getObjectMap();

	for (LLSD::map_const_iterator characterDataIter = pCharacterListData.beginMap();
		characterDataIter != pCharacterListData.endMap(); ++characterDataIter)
	{
		const std::string& uuid(characterDataIter->first);
		const LLSD& characterData = characterDataIter->second;
		LLPathfindingObjectPtr character(new LLPathfindingCharacter(uuid, characterData));
		objectMap.insert(std::pair<std::string, LLPathfindingObjectPtr>(uuid, character));
	}
}
开发者ID:1234-,项目名称:SingularityViewer,代码行数:13,代码来源:llpathfindingcharacterlist.cpp

示例15: result

    void result(const LLSD& content)
    {
		if(!mRegion || LLHTTPClient::ResponderPtr(this) != mRegion->getHttpResponderPtr()) //region is removed or responder is not created.
		{
			return ;
		}

		LLSD::map_const_iterator iter;
		for(iter = content.beginMap(); iter != content.endMap(); ++iter)
		{
			mRegion->setCapability( iter->first, iter->second );
		}
	}
开发者ID:greythane,项目名称:slitechat,代码行数:13,代码来源:llviewerregion.cpp


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