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


C++ NodeList::end方法代码示例

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


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

示例1: parse_file

void parse_file( bool do_html, istream& input_stream, ostream& output_stream )
{
	DomParser parser;
	parser.set_substitute_entities( true );
	parser.parse_stream( input_stream );
	if ( parser )
	{
		/* if succesfull create output */
		const Element * rootNode = parser.get_document()->get_root_node();
		if ( rootNode == NULL )
		{
			throw runtime_error( "get_root_node() failed" );
		}

		OutputBuilder* b;
		if ( do_html )
		{
			b = new HtmlBuilder( output_stream );
		} else
		{
			b = new LatexBuilder( output_stream );
		}

		/* do stuff */
		{
			const Element & root_in = dynamic_cast<const Element &>( *rootNode );
			if ( root_in.get_name() != "document" )
			{
				throw runtime_error( "root node must be document" );
			}
			OutputState * s = b->create_root();
			Node::NodeList list = root_in.get_children();
			for ( Node::NodeList::iterator iter = list.begin(); iter != list.end(); ++iter )
			{
				if ( *iter != NULL )
				{
					parse_node( **iter, * s );
				}
			}
			s->finish();
			delete s;
		}
		delete b;
	}
}
开发者ID:MarcAntoine-Arnaud,项目名称:xml2epub,代码行数:45,代码来源:options.hpp

示例2: loadLabels

bool PinotSettings::loadLabels(const Element *pElem)
{
	if (pElem == NULL)
	{
		return false;
	}

	Node::NodeList childNodes = pElem->get_children();
	if (childNodes.empty() == true)
	{
		return false;
	}

	// Load the label's properties
	for (Node::NodeList::iterator iter = childNodes.begin(); iter != childNodes.end(); ++iter)
	{
		Node *pNode = (*iter);
		Element *pElem = dynamic_cast<Element*>(pNode);
		if (pElem == NULL)
		{
			continue;
		}

		string nodeName = pElem->get_name();
		string nodeContent = getElementContent(pElem);

		if (nodeName == "name")
		{
			m_labels.insert(nodeContent);
		}
		// Labels used to have colours...
	}

	return true;
}
开发者ID:BackupTheBerlios,项目名称:pinot-svn,代码行数:35,代码来源:PinotSettings.cpp

示例3: loadFilePatterns

bool PinotSettings::loadFilePatterns(const Element *pElem)
{
	if (pElem == NULL)
	{
		return false;
	}

	Node::NodeList childNodes = pElem->get_children();
	if (childNodes.empty() == true)
	{
		return false;
	}

	// Load the file patterns list
	for (Node::NodeList::iterator iter = childNodes.begin(); iter != childNodes.end(); ++iter)
	{
		Node *pNode = (*iter);
		Element *pElem = dynamic_cast<Element*>(pNode);
		if (pElem == NULL)
		{
			continue;
		}

		string nodeName = pElem->get_name();
		string nodeContent = getElementContent(pElem);

		if (nodeName == "pattern")
		{
			m_filePatternsBlackList.insert(nodeContent);
		}
	}

	return true;
}
开发者ID:BackupTheBerlios,项目名称:pinot-svn,代码行数:34,代码来源:PinotSettings.cpp

示例4: fromXML

void CharacterList::fromXML(const xmlpp::Element &root)
{
    using namespace xmlpp;

    clear();
    Node::NodeList node = root.get_children("character");
    for (Node::NodeList::const_iterator it = node.begin(); it != node.end(); it++)
    {
        Element *elem = dynamic_cast<Element*>(*it);
        string name;
        Attribute *attr = elem->get_attribute("name");
        if (attr != NULL)
        {
            name = attr->get_value();
        }
        string playerName="";
        attr = elem->get_attribute("playername");
        if (attr != NULL)
        {
            playerName = attr->get_value();
        }
        Character character = Character(name,playerName);
        character.fromXML(*elem);
        vCharacters.push_back(character);
    }        
}
开发者ID:Dramac,项目名称:GM-Assistant,代码行数:26,代码来源:CharacterList.cpp

示例5: loadUi

bool PinotSettings::loadUi(const Element *pElem)
{
	if (pElem == NULL)
	{
		return false;
	}

	Node::NodeList childNodes = pElem->get_children();
	if (childNodes.empty() == true)
	{
		return false;
	}

	for (Node::NodeList::iterator iter = childNodes.begin(); iter != childNodes.end(); ++iter)
	{
		Node *pNode = (*iter);
		Element *pElem = dynamic_cast<Element*>(pNode);
		if (pElem == NULL)
		{
			continue;
		}

		string nodeName = pElem->get_name();
		string nodeContent = getElementContent(pElem);
		if (nodeName == "xpos")
		{
			m_xPos = atoi(nodeContent.c_str());
		}
		else if (nodeName == "ypos")
		{
			m_yPos = atoi(nodeContent.c_str());
		}
		else if (nodeName == "width")
		{
			m_width = atoi(nodeContent.c_str());
		}
		else if (nodeName == "height")
		{
			m_height = atoi(nodeContent.c_str());
		}
		else if (nodeName == "panepos")
		{
			m_panePos = atoi(nodeContent.c_str());
		}
		else if (nodeName == "expandqueries")
		{
			if (nodeContent == "YES")
			{
				m_expandQueries = true;
			}
			else
			{
				m_expandQueries = false;
			}
		}
	}

	return true;
}
开发者ID:BackupTheBerlios,项目名称:pinot-svn,代码行数:59,代码来源:PinotSettings.cpp

示例6: loadMailAccounts

bool PinotSettings::loadMailAccounts(const Element *pElem)
{
	if (pElem == NULL)
	{
		return false;
	}

	Node::NodeList childNodes = pElem->get_children();
	if (childNodes.empty() == true)
	{
		return false;
	}

	MailAccount mailAccount;

	// Load the mail account's properties
	for (Node::NodeList::iterator iter = childNodes.begin(); iter != childNodes.end(); ++iter)
	{
		Node *pNode = (*iter);
		Element *pElem = dynamic_cast<Element*>(pNode);
		if (pElem == NULL)
		{
			continue;
		}

		string nodeName = pElem->get_name();
		string nodeContent = getElementContent(pElem);

		if (nodeName == "name")
		{
			mailAccount.m_name = nodeContent;
		}
		else if (nodeName == "type")
		{
			mailAccount.m_type = nodeContent;
		}
		else if (nodeName == "mtime")
		{
			mailAccount.m_modTime = (time_t)atoi(nodeContent.c_str());
		}
		else if (nodeName == "mindate")
		{
			mailAccount.m_lastMessageTime = (time_t)atoi(nodeContent.c_str());
		}
		else if (nodeName == "size")
		{
			mailAccount.m_size = (off_t)atoi(nodeContent.c_str());
		}
	}

	if (mailAccount.m_name.empty() == false)
	{
		m_mailAccounts.insert(mailAccount);
	}

	return true;
}
开发者ID:BackupTheBerlios,项目名称:pinot-svn,代码行数:57,代码来源:PinotSettings.cpp

示例7: loadLabels

bool PinotSettings::loadLabels(const Element *pElem)
{
	if (pElem == NULL)
	{
		return false;
	}

	Node::NodeList childNodes = pElem->get_children();
	if (childNodes.empty() == true)
	{
		return false;
	}

	Label label;

	// Load the label's properties
	for (Node::NodeList::iterator iter = childNodes.begin(); iter != childNodes.end(); ++iter)
	{
		Node *pNode = (*iter);
		Element *pElem = dynamic_cast<Element*>(pNode);
		if (pElem == NULL)
		{
			continue;
		}

		string nodeName = pElem->get_name();
		string nodeContent = getElementContent(pElem);

		if (nodeName == "name")
		{
			label.m_name = nodeContent;
		}
		else if (nodeName == "red")
		{
			label.m_red = (unsigned short)atoi(nodeContent.c_str());
		}
		else if (nodeName == "green")
		{
			label.m_green = (unsigned short)atoi(nodeContent.c_str());
		}
		else if (nodeName == "blue")
		{
			label.m_blue = (unsigned short)atoi(nodeContent.c_str());
		}
	}

	if (label.m_name.empty() == false)
	{
		m_labels.insert(label);
	}

	return true;
}
开发者ID:BackupTheBerlios,项目名称:pinot-svn,代码行数:53,代码来源:PinotSettings.cpp

示例8: loadIndexableLocations

bool PinotSettings::loadIndexableLocations(const Element *pElem)
{
	if (pElem == NULL)
	{
		return false;
	}

	Node::NodeList childNodes = pElem->get_children();
	if (childNodes.empty() == true)
	{
		return false;
	}

	IndexableLocation location;

	// Load the indexable location's properties
	for (Node::NodeList::iterator iter = childNodes.begin(); iter != childNodes.end(); ++iter)
	{
		Node *pNode = (*iter);
		Element *pElem = dynamic_cast<Element*>(pNode);
		if (pElem == NULL)
		{
			continue;
		}

		string nodeName = pElem->get_name();
		string nodeContent = getElementContent(pElem);

		if (nodeName == "name")
		{
			location.m_name = nodeContent;
		}
		else if (nodeName == "monitor")
		{
			if (nodeContent == "YES")
			{
				location.m_monitor = true;
			}
			else
			{
				location.m_monitor = false;
			}
		}
	}

	if (location.m_name.empty() == false)
	{
		m_indexableLocations.insert(location);
	}

	return true;
}
开发者ID:BackupTheBerlios,项目名称:pinot-svn,代码行数:52,代码来源:PinotSettings.cpp

示例9: loadProxy

bool PinotSettings::loadProxy(const Element *pElem)
{
	if (pElem == NULL)
	{
		return false;
	}

	Node::NodeList childNodes = pElem->get_children();
	if (childNodes.empty() == true)
	{
		return false;
	}

	for (Node::NodeList::iterator iter = childNodes.begin(); iter != childNodes.end(); ++iter)
	{
		Node *pNode = (*iter);
		Element *pChildElem = dynamic_cast<Element*>(pNode);
		if (pChildElem == NULL)
		{
			continue;
		}

		string nodeName(pChildElem->get_name());
		string nodeContent(getElementContent(pChildElem));

		if (nodeName == "address")
		{
			m_proxyAddress = nodeContent;
		}
		else if (nodeName == "port")
		{
			m_proxyPort = (unsigned int)atoi(nodeContent.c_str());
		}
		else if (nodeName == "type")
		{
			m_proxyType = nodeContent;
		}
		else if (nodeName == "enable")
		{
			if (nodeContent == "YES")
			{
				m_proxyEnabled = true;
			}
			else
			{
				m_proxyEnabled = false;
			}
		}	
	}

	return true;
}
开发者ID:BackupTheBerlios,项目名称:pinot-svn,代码行数:52,代码来源:PinotSettings.cpp

示例10: p

intg pascal_dataset<Tdata>::count_samples() {
  total_difficult = 0;
  total_truncated = 0;
  total_occluded = 0;
  total_ignored = 0;
  total_samples = 0;
  std::string xmlpath;
  boost::filesystem::path p(annroot);
  if (!boost::filesystem::exists(p))
    eblthrow("Annotation path " << annroot << " does not exist.");
  std::cout << "Counting number of samples in " << annroot << " ..."
            << std::endl;
  // find all xml files recursively
  std::list<std::string> *files = find_fullfiles(annroot, XML_PATTERN, NULL,
                                                 false, true);
  if (!files || files->size() == 0)
    eblthrow("no xml files found in " << annroot << " using file pattern "
             << XML_PATTERN);
  std::cout << "Found " << files->size() << " xml files." << std::endl;
  for (std::list<std::string>::iterator i = files->begin(); i != files->end(); ++i) {
    xmlpath = *i;
    // parse xml
    DomParser parser;
    parser.parse_file(xmlpath);
    if (parser) {
      // initialize root node and list
      const Node* pNode = parser.get_document()->get_root_node();
      Node::NodeList list = pNode->get_children();
      // parse all objects in image
      for(Node::NodeList::iterator iter = list.begin();
          iter != list.end(); ++iter) {
        if (!strcmp((*iter)->get_name().c_str(), "object")) {
          // check for difficult flag in object node
          Node::NodeList olist = (*iter)->get_children();
          count_sample(olist);
        }
      }
    }
  }
  if (files) delete files;
  std::cout << "Found: " << total_samples << " samples, including ";
  std::cout << total_difficult << " difficult, " << total_truncated;
  std::cout << " truncated and " << total_occluded << " occluded." << std::endl;
  ignore_difficult ? std::cout << "Ignoring" : std::cout << "Using";
  std::cout << " difficult samples." << std::endl;
  ignore_truncated ? std::cout << "Ignoring" : std::cout << "Using";
  std::cout << " truncated samples." << std::endl;
  ignore_occluded ? std::cout << "Ignoring" : std::cout << "Using";
  std::cout << " occluded samples." << std::endl;
  total_samples = total_samples - total_ignored;
  return total_samples;
}
开发者ID:2php,项目名称:eblearn,代码行数:52,代码来源:pascal_dataset.hpp

示例11: fromXML

void Character::fromXML(const xmlpp::Element &root)
{
    using namespace xmlpp;

    clearSkills();
    Node::NodeList list = root.get_children("skill");
    for (Node::NodeList::const_iterator it = list.begin(); it != list.end(); it++)
    {
        Element *elem = dynamic_cast<Element *>(*it);
        string value;
        Attribute *attr = elem->get_attribute("value");
        if (attr != NULL)
        {
            value = attr->get_value();
        }
        vSkills.push_back(value);
    }
}
开发者ID:Dramac,项目名称:GM-Assistant,代码行数:18,代码来源:Character.cpp

示例12: loadIndexes

bool PinotSettings::loadIndexes(const Element *pElem)
{
	if (pElem == NULL)
	{
		return false;
	}

	Node::NodeList childNodes = pElem->get_children();
	if (childNodes.empty() == true)
	{
		return false;
	}

	string indexName, indexLocation;

	for (Node::NodeList::iterator iter = childNodes.begin(); iter != childNodes.end(); ++iter)
	{
		Node *pNode = (*iter);
		Element *pElem = dynamic_cast<Element*>(pNode);
		if (pElem == NULL)
		{
			continue;
		}

		string nodeName = pElem->get_name();
		string nodeContent = getElementContent(pElem);
		if (nodeName == "name")
		{
			indexName = nodeContent;
		}
		else if (nodeName == "location")
		{
			indexLocation = nodeContent;
		}
	}

	if ((indexName.empty() == false) &&
		(indexLocation.empty() == false))
	{
		addIndex(indexName, indexLocation);
	}

	return true;
}
开发者ID:BackupTheBerlios,项目名称:pinot-svn,代码行数:44,代码来源:PinotSettings.cpp

示例13: loadColour

bool PinotSettings::loadColour(const Element *pElem)
{
	if (pElem == NULL)
	{
		return false;
	}

	Node::NodeList childNodes = pElem->get_children();
	if (childNodes.empty() == true)
	{
		return false;
	}

	// Load the colour RGB components
	for (Node::NodeList::iterator iter = childNodes.begin(); iter != childNodes.end(); ++iter)
	{
		Node *pNode = (*iter);
		Element *pElem = dynamic_cast<Element*>(pNode);
		if (pElem == NULL)
		{
			continue;
		}

		string nodeName = pElem->get_name();
		string nodeContent = getElementContent(pElem);
		gushort value = (gushort)atoi(nodeContent.c_str());

		if (nodeName == "red")
		{
			m_newResultsColourRed = value;
		}
		else if (nodeName == "green")
		{
			m_newResultsColourGreen = value;
		}
		else if (nodeName == "blue")
		{
			m_newResultsColourBlue = value;
		}
	}

	return true;
}
开发者ID:BackupTheBerlios,项目名称:pinot-svn,代码行数:43,代码来源:PinotSettings.cpp

示例14: loadResults

bool PinotSettings::loadResults(const Element *pElem)
{
	if (pElem == NULL)
	{
		return false;
	}

	Node::NodeList childNodes = pElem->get_children();
	if (childNodes.empty() == true)
	{
		return false;
	}

	for (Node::NodeList::iterator iter = childNodes.begin(); iter != childNodes.end(); ++iter)
	{
		Node *pNode = (*iter);
		Element *pElem = dynamic_cast<Element*>(pNode);
		if (pElem == NULL)
		{
			continue;
		}

		string nodeName = pElem->get_name();
		string nodeContent = getElementContent(pElem);
		if (nodeName == "viewmode")
		{
			if (nodeContent == "SOURCE")
			{
				m_browseResults = false;
			}
			else
			{
				m_browseResults = true;
			}
		}
		else if (nodeName == "browser")
		{
			m_browserCommand = nodeContent;
		}
	}

	return true;
}
开发者ID:BackupTheBerlios,项目名称:pinot-svn,代码行数:43,代码来源:PinotSettings.cpp

示例15: loadEngineChannels

bool PinotSettings::loadEngineChannels(const Element *pElem)
{
	if (pElem == NULL)
	{
		return false;
	}

	Node::NodeList childNodes = pElem->get_children();
	if (childNodes.empty() == true)
	{
		return false;
	}

	for (Node::NodeList::iterator iter = childNodes.begin(); iter != childNodes.end(); ++iter)
	{
		Node *pNode = (*iter);
		Element *pElem = dynamic_cast<Element*>(pNode);
		if (pElem == NULL)
		{
			continue;
		}

		string nodeName = pElem->get_name();
		string nodeContent = getElementContent(pElem);
		if (nodeName == "name")
		{
			std::map<string, bool>::iterator channelIter = m_engineChannels.find(nodeContent);

			if (channelIter != m_engineChannels.end())
			{
				channelIter->second = false;
			}
		}
	}

	return true;
}
开发者ID:BackupTheBerlios,项目名称:pinot-svn,代码行数:37,代码来源:PinotSettings.cpp


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