本文整理汇总了C++中LLXmlTreeNode::getNextNamedChild方法的典型用法代码示例。如果您正苦于以下问题:C++ LLXmlTreeNode::getNextNamedChild方法的具体用法?C++ LLXmlTreeNode::getNextNamedChild怎么用?C++ LLXmlTreeNode::getNextNamedChild使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类LLXmlTreeNode
的用法示例。
在下文中一共展示了LLXmlTreeNode::getNextNamedChild方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: 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;
}
示例2: 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;
}