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


C++ LLXmlTreeNode::getChildByName方法代码示例

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


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

示例1: completedRaw

void exoFlickrUploadResponse::completedRaw(
										  U32 status,
										  const std::string& reason,
										  const LLChannelDescriptors& channels,
										  const LLIOPipe::buffer_ptr_t& buffer)
{
	LLBufferStream istr(channels, buffer.get());
	std::stringstream strstrm;
	strstrm << istr.rdbuf();
	std::string result = std::string(strstrm.str());

	LLSD output;
	bool success;

	LLXmlTree tree;
	if(!tree.parseString(result))
	{
		LL_WARNS("FlickrAPI") << "Couldn't parse flickr response(" << status << "): " << result << LL_ENDL;
		mCallback(false, LLSD());
		return;
	}
	LLXmlTreeNode* root = tree.getRoot();
	if(!root->hasName("rsp"))
	{
		LL_WARNS("FlickrAPI") << "Bad root node: " << root->getName() << LL_ENDL;
		mCallback(false, LLSD());
		return;
	}
	std::string stat;
	root->getAttributeString("stat", stat);
	output["stat"] = stat;
	if(stat == "ok")
	{
		success = true;
		LLXmlTreeNode* photoid_node = root->getChildByName("photoid");
		if(photoid_node)
		{
			output["photoid"] = photoid_node->getContents();
		}
	}
	else
	{
		success = false;
		LLXmlTreeNode* err_node = root->getChildByName("err");
		if(err_node)
		{
			S32 code;
			std::string msg;
			err_node->getAttributeS32("code", code);
			err_node->getAttributeString("msg", msg);
			output["code"] = code;
			output["msg"] = msg;
		}
	}
	mCallback(success, output);
}
开发者ID:JohnMcCaffery,项目名称:Armadillo-Phoenix,代码行数:56,代码来源:exoflickr.cpp

示例2: parseXml

BOOL LLTexGlobalColorInfo::parseXml(LLXmlTreeNode* node)
{
	// name attribute
	static LLStdStringHandle name_string = LLXmlTree::addAttributeString("name");
	if (!node->getFastAttributeString(name_string, mName))
	{
		llwarns << "<global_color> element is missing name attribute." << llendl;
		return FALSE;
	}
	// <param> sub-element
	for (LLXmlTreeNode* child = node->getChildByName("param");
		 child;
		 child = node->getNextNamedChild())
	{
		if (child->getChildByName("param_color"))
		{
			// <param><param_color/></param>
			LLTexLayerParamColorInfo* info = new LLTexLayerParamColorInfo();
			if (!info->parseXml(child))
			{
				delete info;
				return FALSE;
			}
			mParamColorInfoList.push_back(info);
		}
	}
	return TRUE;
}
开发者ID:OS-Development,项目名称:VW.Kirsten,代码行数:28,代码来源:lltexglobalcolor.cpp

示例3: load

BOOL LLGenePool::load()
{
	std::string filename;

	filename = gDirUtilp->getExpandedFilename(LL_PATH_CHARACTER,"genepool.xml");
	if( mLoaded )
	{
		return TRUE;
	}

	LLXmlTree xml_tree;
	BOOL success = xml_tree.parseFile( filename, FALSE );
	if( !success )
	{
		return FALSE;
	}

	LLXmlTreeNode* root = xml_tree.getRoot();
	if( !root )
	{
		return FALSE;
	}

	//-------------------------------------------------------------------------
	// <linden_genepool version="1.0"> (root)
	//-------------------------------------------------------------------------
	if( !root->hasName( "linden_genepool" ) )
	{
		llwarns << "Invalid linden_genepool file header: " << filename << llendl;
		return FALSE;
	}

	std::string version;
	static LLStdStringHandle version_string = LLXmlTree::addAttributeString("version");
	if( !root->getFastAttributeString( version_string, version ) || (version != "1.0") )
	{
		llwarns << "Invalid linden_genepool file version: " << version << llendl;
		return FALSE;
	}

	//-------------------------------------------------------------------------
	// <archetype>
	//-------------------------------------------------------------------------
	for (LLXmlTreeNode* child = root->getChildByName( "archetype" );
		 child;
		 child = root->getNextNamedChild())
	{
		if( !loadNodeArchetype( child ) )
		{
			return FALSE;
		}
	}

	mLoaded = TRUE;
	return TRUE;
}
开发者ID:Boy,项目名称:rainbow,代码行数:56,代码来源:llgenepool.cpp

示例4: loadAttentions

static BOOL loadAttentions()
{
	static BOOL first_time = TRUE;
	if( ! first_time) 
	{
		return TRUE; // maybe not ideal but otherwise it can continue to fail forever.
	}
	first_time = FALSE;
	
	std::string filename;
	filename = gDirUtilp->getExpandedFilename(LL_PATH_CHARACTER,"attentions.xml");
	LLXmlTree xml_tree;
	BOOL success = xml_tree.parseFile( filename, FALSE );
	if( !success )
	{
		return FALSE;
	}
	LLXmlTreeNode* root = xml_tree.getRoot();
	if( !root )
	{
		return FALSE;
	}

	//-------------------------------------------------------------------------
	// <linden_attentions version="1.0"> (root)
	//-------------------------------------------------------------------------
	if( !root->hasName( "linden_attentions" ) )
	{
		llwarns << "Invalid linden_attentions file header: " << filename << llendl;
		return FALSE;
	}

	std::string version;
	static LLStdStringHandle version_string = LLXmlTree::addAttributeString("version");
	if( !root->getFastAttributeString( version_string, version ) || (version != "1.0") )
	{
		llwarns << "Invalid linden_attentions file version: " << version << llendl;
		return FALSE;
	}

	//-------------------------------------------------------------------------
	// <gender>
	//-------------------------------------------------------------------------
	for (LLXmlTreeNode* child = root->getChildByName( "gender" );
		 child;
		 child = root->getNextNamedChild())
	{
		if( !loadGender( child ) )
		{
			return FALSE;
		}
	}

	return TRUE;
}
开发者ID:,项目名称:,代码行数:55,代码来源:


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