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


C++ LLSD类代码示例

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


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

示例1: XMLRPC_VectorNext

LLSD LLUserAuth::parseValues(UserAuthcode &auth_code, const std::string& key_pfx, XMLRPC_VALUE param)
{
	auth_code = E_OK;
	LLSD responses;
	for(XMLRPC_VALUE current = XMLRPC_VectorRewind(param); current;
		current = XMLRPC_VectorNext(param))
	{
		std::string key(XMLRPC_GetValueID(current));
		lldebugs << "key: " << key_pfx << key << llendl;
		XMLRPC_VALUE_TYPE_EASY type = XMLRPC_GetValueTypeEasy(current);
		if(xmlrpc_type_string == type)
		{
			LLSD::String val(XMLRPC_GetValueString(current));
			lldebugs << "val: " << val << llendl;
			responses.insert(key,val);
		}
		else if(xmlrpc_type_int == type)
		{
			LLSD::Integer val(XMLRPC_GetValueInt(current));
			lldebugs << "val: " << val << llendl;
			responses.insert(key,val);
		}
		else if (xmlrpc_type_double == type)
        {
			LLSD::Real val(XMLRPC_GetValueDouble(current));
            lldebugs << "val: " << val << llendl;
			responses.insert(key,val);
		}
		else if(xmlrpc_type_array == type)
		{
			// We expect this to be an array of submaps. Walk the array,
			// recursively parsing each submap and collecting them.
			LLSD array;
			int i = 0;          // for descriptive purposes
			for (XMLRPC_VALUE row = XMLRPC_VectorRewind(current); row;
				row = XMLRPC_VectorNext(current), ++i)
			{
				// Recursive call. For the lower-level key_pfx, if 'key'
				// is "foo", pass "foo[0]:", then "foo[1]:", etc. In the
				// nested call, a subkey "bar" will then be logged as
				// "foo[0]:bar", and so forth.
				// Parse the scalar subkey/value pairs from this array
				// entry into a temp submap. Collect such submaps in 'array'.
				std::string key_prefix = key_pfx;
				array.append(parseValues(auth_code,
									STRINGIZE(key_pfx << key << '[' << i << "]:"),
									row));
			}
			// Having collected an 'array' of 'submap's, insert that whole
			// 'array' as the value of this 'key'.
			responses.insert(key, array);
		}
		else if (xmlrpc_type_struct == type)
    	{
    		LLSD submap = parseValues(auth_code,
            						STRINGIZE(key_pfx << key << ':'),
            						current);
            responses.insert(key, submap);
        }
        else
        {
        	// whoops - unrecognized type
            llwarns << "Unhandled xmlrpc type " << type << " for key "
                                        << key_pfx << key << LL_ENDL;
            responses.insert(key, STRINGIZE("<bad XMLRPC type " << type << '>'));
            auth_code = E_UNHANDLED_ERROR;
        }
    }
    return responses;
}
开发者ID:OS-Development,项目名称:VW.Singularity,代码行数:70,代码来源:lluserauth.cpp

示例2: configure

void LLControlGroupCLP::configure(const std::string& config_filename, LLControlGroup* controlGroup)
{
    // This method reads the llsd based config file, and uses it to set 
    // members of a control group.
    LLSD clpConfigLLSD;
    
    llifstream input_stream;
    input_stream.open(config_filename, std::ios::in | std::ios::binary);

    if(input_stream.is_open())
    {
        LLSDSerialize::fromXML(clpConfigLLSD, input_stream);
        for(LLSD::map_iterator option_itr = clpConfigLLSD.beginMap(); 
            option_itr != clpConfigLLSD.endMap(); 
            ++option_itr)
        {
            LLSD::String long_name = option_itr->first;
            LLSD option_params = option_itr->second;
            
            std::string desc("n/a");
            if(option_params.has("desc"))
            {
                desc = option_params["desc"].asString();
            }
            
            std::string short_name = LLStringUtil::null;
            if(option_params.has("short"))
            {
                short_name = option_params["short"].asString();
            }

            unsigned int token_count = 0;
            if(option_params.has("count"))
            {
                token_count = option_params["count"].asInteger();
            }

            bool composing = false;
            if(option_params.has("compose"))
            {
                composing = option_params["compose"].asBoolean();
            }

            bool positional = false;
            if(option_params.has("positional"))
            {
                positional = option_params["positional"].asBoolean();
            }

            bool last_option = false;
            if(option_params.has("last_option"))
            {
                last_option = option_params["last_option"].asBoolean();
            }

            boost::function1<void, const token_vector_t&> callback;
            if(option_params.has("map-to") && (NULL != controlGroup))
            {
                std::string controlName = option_params["map-to"].asString();
                callback = boost::bind(setControlValueCB, _1, 
                                       controlName, controlGroup);
            }

            this->addOptionDesc(
                long_name, 
                callback,
                token_count, 
                desc, 
                short_name, 
                composing,
                positional,
                last_option);
        }
    }
}
开发者ID:CmdrCupcake,项目名称:SingularityViewer,代码行数:75,代码来源:llcommandlineparser.cpp

示例3: onUpdateFilter

void LLFloaterSettingsDebug::onUpdateFilter(const LLSD& value)
{
    updateFilter(value.asString());
}
开发者ID:nebadon2025,项目名称:replex,代码行数:4,代码来源:llfloatersettingsdebug.cpp

示例4: handleDebugViewsChanged

static bool handleDebugViewsChanged(const LLSD& newvalue)
{
	LLView::sDebugRects = newvalue.asBoolean();
	return true;
}
开发者ID:Avian-IW,项目名称:InWorldz-Viewer,代码行数:5,代码来源:llviewercontrol.cpp

示例5: handleRenderAvatarMouselookChanged

static bool handleRenderAvatarMouselookChanged(const LLSD& newvalue)
{
	LLVOAvatar::sVisibleInFirstPerson = newvalue.asBoolean();
	return true;
}
开发者ID:Avian-IW,项目名称:InWorldz-Viewer,代码行数:5,代码来源:llviewercontrol.cpp

示例6: handleRenderUseImpostorsChanged

static bool handleRenderUseImpostorsChanged(const LLSD& newvalue)
{
	LLVOAvatar::sUseImpostors = newvalue.asBoolean();
	return true;
}
开发者ID:Avian-IW,项目名称:InWorldz-Viewer,代码行数:5,代码来源:llviewercontrol.cpp

示例7: handleRenderDebugGLChanged

static bool handleRenderDebugGLChanged(const LLSD& newvalue)
{
	gDebugGL = newvalue.asBoolean();
	gGL.clearErrors();
	return true;
}
开发者ID:Avian-IW,项目名称:InWorldz-Viewer,代码行数:6,代码来源:llviewercontrol.cpp

示例8: handleAvatarLODChanged

static bool handleAvatarLODChanged(const LLSD& newvalue)
{
	LLVOAvatar::sLODFactor = (F32) newvalue.asReal();
	return true;
}
开发者ID:Avian-IW,项目名称:InWorldz-Viewer,代码行数:5,代码来源:llviewercontrol.cpp

示例9: handleAvatarMaxVisibleChanged

static bool handleAvatarMaxVisibleChanged(const LLSD& newvalue)
{
	LLVOAvatar::sMaxVisible = (U32) newvalue.asInteger();
	return true;
}
开发者ID:Avian-IW,项目名称:InWorldz-Viewer,代码行数:5,代码来源:llviewercontrol.cpp

示例10: handleSetSelfInvisible

static bool handleSetSelfInvisible( const LLSD& newvalue)
{
	LLVOAvatar::onChangeSelfInvisible( newvalue.asBoolean() );
	return true;
}
开发者ID:Avian-IW,项目名称:InWorldz-Viewer,代码行数:5,代码来源:llviewercontrol.cpp

示例11: handleVolumeLODChanged

static bool handleVolumeLODChanged(const LLSD& newvalue)
{
	LLVOVolume::sLODFactor = (F32) newvalue.asReal();
	LLVOVolume::sDistanceFactor = 1.f-LLVOVolume::sLODFactor * 0.1f;
	return true;
}
开发者ID:Avian-IW,项目名称:InWorldz-Viewer,代码行数:6,代码来源:llviewercontrol.cpp

示例12: handleTerrainDetailChanged

static bool handleTerrainDetailChanged(const LLSD& newvalue)
{
	LLDrawPoolTerrain::sDetailMode = newvalue.asInteger();
	return true;
}
开发者ID:Avian-IW,项目名称:InWorldz-Viewer,代码行数:5,代码来源:llviewercontrol.cpp

示例13: onVolumeChange

void LLInspectAvatar::onVolumeChange(const LLSD& data)
{
    F32 volume = (F32)data.asReal();
    LLVoiceClient::getInstance()->setUserVolume(mAvatarID, volume);
}
开发者ID:Belxjander,项目名称:Kirito,代码行数:5,代码来源:llinspectavatar.cpp

示例14: processNotify

void LLAvatarTracker::processNotify(LLMessageSystem* msg, bool online)
{
	S32 count = msg->getNumberOfBlocksFast(_PREHASH_AgentBlock);
	BOOL chat_notify = gSavedSettings.getBOOL("ChatOnlineNotification");

	lldebugs << "Received " << count << " online notifications **** " << llendl;
	if(count > 0)
	{
		LLUUID agent_id;
		const LLRelationship* info = NULL;
		LLUUID tracking_id;
		if(mTrackingData)
		{
			tracking_id = mTrackingData->mAvatarID;
		}
		BOOL notify = FALSE;
		LLSD args;
		LLSD payload;
		for(S32 i = 0; i < count; ++i)
		{
			msg->getUUIDFast(_PREHASH_AgentBlock, _PREHASH_AgentID, agent_id, i);
			payload["FROM_ID"] = agent_id;
			info = getBuddyInfo(agent_id);
			if(info)
			{
				setBuddyOnline(agent_id,online);
				if(chat_notify)
				{
					std::string first, last;
					if(gCacheName->getName(agent_id, first, last))
					{
						notify = TRUE;
						args["FIRST"] = first;
						args["LAST"] = last;
					}

				}
			}
			else
			{
				llwarns << "Received online notification for unknown buddy: " 
					<< agent_id << " is " << (online ? "ONLINE" : "OFFLINE") << llendl;
			}

			if(tracking_id == agent_id)
			{
				// we were tracking someone who went offline
				deleteTrackingData();
			}
			// *TODO: get actual inventory id
			gInventory.addChangedMask(LLInventoryObserver::CALLING_CARD, LLUUID::null);
		}
		if(notify)
		{
			// Popup a notify box with online status of this agent
			LLNotificationPtr notification;

			if (online)
			{
				notification =
					LLNotificationsUtil::add("FriendOnline",
											 args,
											 payload.with("respond_on_mousedown", TRUE),
											 boost::bind(&LLAvatarActions::startIM, agent_id));
			}
			else
			{
				notification =
					LLNotificationsUtil::add("FriendOffline", args, payload);
			}

			// If there's an open IM session with this agent, send a notification there too.
			LLUUID session_id = LLIMMgr::computeSessionID(IM_NOTHING_SPECIAL, agent_id);
			std::string notify_msg = notification->getMessage();
			LLIMModel::instance().proccessOnlineOfflineNotification(session_id, notify_msg);
		}

		mModifyMask |= LLFriendObserver::ONLINE;
		instance().notifyObservers();
		gInventory.notifyObservers();
	}
}
开发者ID:HyangZhao,项目名称:NaCl-main,代码行数:82,代码来源:llcallingcard.cpp

示例15: handleUploadBakedTexOldChanged

static bool handleUploadBakedTexOldChanged(const LLSD& newvalue)
{
	LLPipeline::sForceOldBakedUpload = newvalue.asBoolean();
	return true;
}
开发者ID:Avian-IW,项目名称:InWorldz-Viewer,代码行数:5,代码来源:llviewercontrol.cpp


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