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


C++ TiXmlNode::NextSibling方法代码示例

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


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

示例1: if

void
SipRedirectorJoin::textContentDeepRecursive(UtlString& string,
                                              TiXmlElement *element)
{
   // Iterate through all the children.
   for (TiXmlNode* child = element->FirstChild(); child;
        child = child->NextSibling())
   {
      // Examine the text nodes.
      if (child->Type() == TiXmlNode::TEXT)
      {
         // Append the content to the string.
         string.append(child->Value());
      }
      else if (child->Type() == TiXmlNode::ELEMENT)
      {
         // Recurse on this element.
         textContentDeepRecursive(string, child->ToElement());
      }
   }
}
开发者ID:ATHLSolutions,项目名称:sipxecs,代码行数:21,代码来源:SipRedirectorJoin.cpp

示例2: CopyTo

void TiXmlElement::CopyTo( TiXmlElement* target ) const
{
	// superclass:
	TiXmlNode::CopyTo( target );

	// Element class: 
	// Clone the attributes, then clone the children.
	const TiXmlAttribute* attribute = 0;
	for(	attribute = attributeSet.First();
	attribute;
	attribute = attribute->Next() )
	{
		target->SetAttribute( attribute->Name(), attribute->Value() );
	}

	TiXmlNode* node = 0;
	for ( node = firstChild; node; node = node->NextSibling() )
	{
		target->LinkEndChild( node->Clone() );
	}
}
开发者ID:bdamage,项目名称:gamescanner,代码行数:21,代码来源:tinyxml.cpp

示例3: Load

void tPlayer::Load()
{
	TiXmlDocument  xmlDoc( (PLAYER_DIR + playername + PLAYER_EXT).c_str() );
	TiXmlElement  *xmlePlr;
	TiXmlNode     *node = 0;
	bool loadOkay = xmlDoc.LoadFile();

	if( loadOkay )
	{
		TiXmlHandle xmlDocHandle( &xmlDoc );

		xmlePlr = xmlDocHandle.FirstChild( "player" ).Element();
		if( xmlePlr != NULL )
		{
			password = xmlePlr->Attribute( "password" );
			room = atoi( xmlePlr->Attribute( "room" ) );
			for( node = xmlePlr->FirstChild( "flags" )->FirstChild( "flag" );
				 node;
				 node = node->NextSibling( "flag" ) )
			{
				flags.insert( node->ToElement()->GetText() );
			}

			node = xmlePlr->FirstChild( "stats" );

			if( node )
			{
				maxhp = atoi( node->FirstChild( "maxHP" )->FirstChild()->Value() );
				curhp = atoi( node->FirstChild( "curHP" )->FirstChild()->Value() );
				baseskl = atoi( node->FirstChild( "baseSkill" )->FirstChild()->Value() );
			}
			else
				throw runtime_error( "Player data corrupt, please contact an admin for assistance" );
		}
	}
	else
		throw runtime_error( "That player does not exist, type 'new' to create a new one." );

} /* end of tPlayer::Load */
开发者ID:narc0tiq,项目名称:tinymudserver,代码行数:39,代码来源:player.cpp

示例4: geoNode

void XmlParser::geoNode(TiXmlNode* pParent) {

	TiXmlNode* pChild;
	for (pChild = pParent->FirstChild(); pChild != 0; pChild = pChild->NextSibling()) {
		int t = pChild->Type();
		if (t == TiXmlNode::ELEMENT) {
			string element_value(pChild->Value());
			if (element_value == "surface")
				objects.push_back(surfaceAttrib(pChild->ToElement()));
			else if (element_value == "cell")
				objects.push_back(cellAttrib(pChild->ToElement()));
			else if (element_value == "lattice")
				objects.push_back(latticeAttrib(pChild->ToElement()));
			else {
				vector<string> keywords;
				keywords.push_back(element_value);
				throw KeywordParserError("Unrecognized geometry keyword <" + element_value + ">",keywords);
			}
		}
	}

}
开发者ID:ajayrawat,项目名称:helios,代码行数:22,代码来源:XmlParserGeometry.cpp

示例5: LoadXML

bool TLFSemanticImageDescriptor::LoadXML(const char* lpFileName)
{
   this->Clear();

   TiXmlDocument doc;
   if (!doc.LoadFile(lpFileName))
    return false;
   TiXmlHandle hDoc(&doc);
   TiXmlElement* pElem = NULL;

   pElem = hDoc.FirstChildElement().Element();
   if (pElem == NULL)
    return false;

   if (strcmp(pElem->Value(), GetName()) != 0)
    return false;

   int w, h;
   pElem->QueryIntAttribute("ImageWidth", &w);
   pElem->QueryIntAttribute("ImageHeight", &h);

   for(TiXmlNode* child = pElem->FirstChild(); child; child = child->NextSibling() )
   {
        TLFDetectedItem* di = new TLFDetectedItem();
        if (strcmp(child->Value(), di->GetName()) != 0)
        {
            Clear();
            return false;
        }
        if (!di->LoadXML(child->ToElement()))
        {
            Clear();
            return false;
        }
        Add(di);
   }

   return true;
}
开发者ID:telnykha,项目名称:VideoA,代码行数:39,代码来源:LFCommon.cpp

示例6: LoadKeymap

bool CButtonTranslator::LoadKeymap(const CStdString &keymapPath)
{
  TiXmlDocument xmlDoc;

  CLog::Log(LOGINFO, "Loading %s", keymapPath.c_str());
  if (!xmlDoc.LoadFile(keymapPath))
  {
    CLog::Log(LOGERROR, "Error loading keymap: %s, Line %d\n%s", keymapPath.c_str(), xmlDoc.ErrorRow(), xmlDoc.ErrorDesc());
    return false;
  }
  TiXmlElement* pRoot = xmlDoc.RootElement();
  CStdString strValue = pRoot->Value();
  if ( strValue != "keymap")
  {
    CLog::Log(LOGERROR, "%s Doesn't contain <keymap>", keymapPath.c_str());
    return false;
  }
  // run through our window groups
  TiXmlNode* pWindow = pRoot->FirstChild();
  while (pWindow)
  {
    if (pWindow->Type() == TiXmlNode::ELEMENT)
    {
      int windowID = WINDOW_INVALID;
      const char *szWindow = pWindow->Value();
      if (szWindow)
      {
        if (strcmpi(szWindow, "global") == 0)
          windowID = -1;
        else
          windowID = TranslateWindow(szWindow);
      }
      MapWindowActions(pWindow, windowID);
    }
    pWindow = pWindow->NextSibling();
  }

  return true;
}
开发者ID:Sky-git,项目名称:xbmc,代码行数:39,代码来源:ButtonTranslator.cpp

示例7: read

void Triangle::read(TiXmlNode* node)
{
	String materialName;
	TiXMLHelper::GetAttribute(node, "materialName", &materialName);
	material = resourceManager.getMaterial(materialName);

	TiXmlNode* vertexInfosNode = node->FirstChild("vertexInfos");
	assert(vertexInfosNode);

	TiXmlNode* vertexInfoNode = vertexInfosNode->FirstChild("vertexInfo");
	int vertexIndex = 0;
	while (vertexInfoNode)
	{
		TiXMLHelper::GetAttribute(vertexInfoNode, "position", &coords[vertexIndex]);

		vertexIndex++;
		vertexInfoNode = vertexInfoNode->NextSibling();
	}
	assert(vertexIndex == 3);

	recomputeNormal();
}
开发者ID:Zaszx,项目名称:RayTracer,代码行数:22,代码来源:Triangle.cpp

示例8: parsePartitioning

void XCFParser::parsePartitioning(TiXmlElement* root){
    TiXmlNode* node = root->FirstChild();


    while (node != NULL){
        if (node->Type() == TiXmlNode::TINYXML_ELEMENT) {
            TiXmlElement* element = (TiXmlElement*)node;
            TiXmlString name(node->Value());

            if (name == XCFMapping::PARTITIONING) {
                parsePartitioning(element);
            }else if (name == XCFMapping::PARTITION) {
                parsePartition(element);
            }else {
                cerr << "Invalid node "<< name.c_str() << endl;
                exit(1);
            }

        }
        node = node->NextSibling();
    }
}
开发者ID:orcc,项目名称:jade,代码行数:22,代码来源:XCFParser.cpp

示例9: LoadLircMap

bool CButtonTranslator::LoadLircMap()
{
  // load our xml file, and fill up our mapping tables
  TiXmlDocument xmlDoc;

  // Load the config file
  CStdString lircmapPath = g_settings.GetUserDataItem("Lircmap.xml");
  CLog::Log(LOGINFO, "Loading %s", lircmapPath.c_str());
  if (!xmlDoc.LoadFile(lircmapPath))
  {
    g_LoadErrorStr.Format("%s, Line %d\n%s", lircmapPath.c_str(), xmlDoc.ErrorRow(), xmlDoc.ErrorDesc());
    return true; // This is so people who don't have the file won't fail, just warn
  }

  lircRemotesMap.clear();
  TiXmlElement* pRoot = xmlDoc.RootElement();
  CStdString strValue = pRoot->Value();
  if (strValue != "lircmap")
  {
    g_LoadErrorStr.Format("%sl Doesn't contain <lircmap>", lircmapPath.c_str());
    return false;
  }

  // run through our window groups
  TiXmlNode* pRemote = pRoot->FirstChild();
  while (pRemote)
  {
    const char *szRemote = pRemote->Value();
    if (szRemote)
    {
      TiXmlAttribute* pAttr = pRemote->ToElement()->FirstAttribute();
      const char* szDeviceName = pAttr->Value();
      MapRemote(pRemote, szDeviceName);
    }
    pRemote = pRemote->NextSibling();
  }
  
  return true;
}
开发者ID:Avoidnf8,项目名称:xbmc-fork,代码行数:39,代码来源:ButtonTranslator.cpp

示例10: ProcessAndValidate

/*
 * TinyXml has loaded and parsed the XML document for us.  We need to
 * run through the DOM tree, pull out the interesting bits, and make
 * sure the stuff we need is present.
 *
 * Returns "true" on success, "false" on failure.
 */
bool PhoneData::ProcessAndValidate(TiXmlDocument* pDoc)
{
    bool deviceFound = false;
    TiXmlNode* pChild;

    assert(pDoc->Type() == TiXmlNode::DOCUMENT);

    for (pChild = pDoc->FirstChild(); pChild != NULL;
        pChild = pChild->NextSibling())
    {
        /*
         * Find the <device> entry.  There should be exactly one.
         */
        if (pChild->Type() == TiXmlNode::ELEMENT) {
            if (strcasecmp(pChild->Value(), "device") != 0) {
                fprintf(stderr,
                    "SimCFG: Warning: unexpected element '%s' at top level\n",
                    pChild->Value());
                continue;
            }
            if (deviceFound) {
                fprintf(stderr, "SimCFG: one <device> per customer\n");
                return false;
            }

            bool result = ProcessDevice(pChild);
            if (!result)
                return false;
            deviceFound = true;
        }
    }

    if (!deviceFound) {
        fprintf(stderr, "SimCFG: no <device> section found\n");
        return false;
    }

    return true;
}
开发者ID:Katarzynasrom,项目名称:patch-hosting-for-android-x86-support,代码行数:46,代码来源:PhoneData.cpp

示例11: parseNewsAndGifts

void User::parseNewsAndGifts(TiXmlNode* xmlNode, Event<std::vector<UserCore::Misc::NewsItem*> > &onEvent)
{
	if (!xmlNode)
		return;

	std::vector<UserCore::Misc::NewsItem*> itemList;

	TiXmlNode* pChild = xmlNode->FirstChild();
	while (pChild)
	{
		if (XML::isValidElement(pChild))
		{
			TiXmlElement *itemElem = pChild->ToElement();

			const char* szId = itemElem->Attribute("id");

			gcString szTitle;
			gcString szUrl;

			XML::GetChild("title", szTitle, itemElem);
			XML::GetChild("url", szUrl, itemElem);
			
			if (szId && szTitle != "" && szUrl != "")
			{
				uint32 id = (uint32)atoi(szId);

				UserCore::Misc::NewsItem *temp = new UserCore::Misc::NewsItem(id, 0, szTitle.c_str(), szUrl.c_str());
				itemList.push_back(temp);
			}
		}

		pChild = pChild->NextSibling();
	}

	if (itemList.size() > 0)
		onEvent(itemList);

	safe_delete(itemList);
}
开发者ID:Alasaad,项目名称:Desurium,代码行数:39,代码来源:User.cpp

示例12: loadScene

Scene* SceneLoader::loadScene(Ogre::DataStreamPtr &data)
{
    TiXmlDocument* doc = loadDocument(data);
    TiXmlElement* root = doc->RootElement();
    Scene* scene = new Scene(getAttributeValueAsString(root, "name"));
    
    for (TiXmlNode* cur = root->FirstChild(); cur; cur = cur->NextSibling())
    {
        if (cur->Type() == TiXmlNode::ELEMENT)
        {
            TiXmlElement* elem = cur->ToElement();
            if (hasNodeName(elem, "map"))
            {
                scene->addMap(getAttributeValueAsStdString(elem, "file"));
            }
        }
    }

    delete doc;

    return scene;
}
开发者ID:BackupTheBerlios,项目名称:dsa-hl-svn,代码行数:22,代码来源:SceneLoader.cpp

示例13: init

bool WSWorld::init()
{
	m_worldPopulation = 0;
	if( !loadTerrain( WSApp::instance()->getSetting("/config/WorldCfg")) )
		return false;

	TiXmlDocument	doc;
	CLog::instance()->log(CLog::msgFlagResources, CLog::msgLvlInfo,__FUNCTION__, _("Loading mobs info..."));
	doc.LoadFile("../data/zones/teeran/mobs.xml");
	if (doc.Error())
	{
		CLog::instance()->log(CLog::msgFlagResources, CLog::msgLvlError,__FUNCTION__, _("XML parser returned an error: %s\n"), doc.ErrorDesc());
		return false;
	}


	TiXmlElement* mobsxml = doc.FirstChildElement("mobs");
	CWorldCharMob::setDefaults(mobsxml);

	TiXmlNode* childNode;
	for ( childNode = mobsxml->FirstChild(); childNode != 0; childNode = childNode->NextSibling() )
		if (childNode->Type() == TiXmlNode::ELEMENT)
			if (!strcmp(childNode->Value(), "mob"))
//			{
				insertEntity(WSEntityPtr(new CWorldCharMob(getNewEntityID(), childNode->ToElement())));
//			 	CharMobPtr mob(new CWorldCharMob(childNode->ToElement()));
//				insertCharMob(mob);
//			}
			else if (!strcmp(childNode->Value(), "flock"))
//			{
				insertEntity(WSEntityPtr(new CMobFlock(getNewEntityID(), childNode->ToElement())));
//				MobFlockPtr flock(new CMobFlock(childNode->ToElement()));
//				m_flocks.push_back(flock);
//			}

	CLog::instance()->log(CLog::msgFlagResources, CLog::msgLvlInfo,__FUNCTION__, _("WSWorld.init: Done."));
	return true;
};
开发者ID:proton,项目名称:ireon,代码行数:38,代码来源:ws_world.cpp

示例14: SetResPkgFindPath

void CLocalPathBrowser::SetResPkgFindPath()
{
	char* aliasArray[] = {"cfg","gui","res","lan","shd"};
	int num = sizeof(aliasArray)/sizeof(char*);

	list<string> lstPath;

	//载入配置文件
	CEditorConfig::GetInst()->InitEditorConfig();

	//加入PathBrowser里面设置的路径
	TiXmlNode* pConfig_xml = CEditorConfig::GetInst()->GetEditorConfig(st_szCtrlType);
	for( TiXmlNode* pNode = pConfig_xml->FirstChild("Path"); pNode; pNode = pNode->NextSibling("Path") )
	{
		TiXmlElement* pElem  = pNode->ToElement();
		if(pElem && pElem->GetText())
		{
			string strText = pElem->GetText();
			lstPath.push_back(strText);
		}
	}

	//lstPath.push_back("F:/company/ybtx/artist/resbin");
	for ( list<string>::iterator iter = lstPath.begin(); iter != lstPath.end(); ++iter )
	{
		for (int i=0;i<num;++i)
		{
			string path = *iter;
			string pathLan = *iter + "/lang";
			string pathRes = *iter + "/res";
			string strTemp = aliasArray[i];
			wstring wstrTemp = gbk_to_utf16(strTemp);
			CPkgFile::AddLoadPath(wstrTemp.c_str(), gbk_to_utf16(path).c_str());
			CPkgFile::AddLoadPath(wstrTemp.c_str(), gbk_to_utf16(pathLan).c_str());
			CPkgFile::AddLoadPath(wstrTemp.c_str(), gbk_to_utf16(pathRes).c_str());
		}
	}
}
开发者ID:LaoZhongGu,项目名称:RushGame,代码行数:38,代码来源:LocalPathBrowser.cpp

示例15: while

void
XmlPrototypesFile::LoadPrototypes()
{
    TiXmlNode* node = m_File.RootElement();

    if( node == NULL || node->ValueStr() != "prototypes" )
    {
        LOG_ERROR( "UI Manager: " + m_File.ValueStr() + " is not a valid prototypes file! No <prototypes> in root." );
        return;
    }

    node = node->FirstChild();
    while( node != NULL )
    {
        if( node->Type() == TiXmlNode::TINYXML_ELEMENT && node->ValueStr() == "prototype" )
        {
            Ogre::String name = GetString( node, "name" );
            UiManager::getSingleton().AddPrototype( name, node->Clone() );
        }

        node = node->NextSibling();
    }
}
开发者ID:DeejStar,项目名称:q-gears,代码行数:23,代码来源:XmlPrototypesFile.cpp


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