2010-07-19 09:57:32 +00:00
|
|
|
#include "pugixml.hpp"
|
|
|
|
|
|
|
|
#include <iostream>
|
|
|
|
|
|
|
|
int main()
|
|
|
|
{
|
|
|
|
pugi::xml_document doc;
|
|
|
|
if (!doc.load_file("xgconsole.xml")) return -1;
|
|
|
|
|
2015-03-21 21:03:01 -07:00
|
|
|
// tag::code[]
|
2010-07-19 09:57:32 +00:00
|
|
|
pugi::xpath_node_set tools = doc.select_nodes("/Profile/Tools/Tool[@AllowRemote='true' and @DeriveCaptionFrom='lastparam']");
|
|
|
|
|
2013-07-10 04:47:25 +00:00
|
|
|
std::cout << "Tools:\n";
|
2010-07-19 09:57:32 +00:00
|
|
|
|
|
|
|
for (pugi::xpath_node_set::const_iterator it = tools.begin(); it != tools.end(); ++it)
|
|
|
|
{
|
|
|
|
pugi::xpath_node node = *it;
|
2013-07-10 04:47:25 +00:00
|
|
|
std::cout << node.node().attribute("Filename").value() << "\n";
|
2010-07-19 09:57:32 +00:00
|
|
|
}
|
|
|
|
|
2014-10-19 07:34:02 +00:00
|
|
|
pugi::xpath_node build_tool = doc.select_node("//Tool[contains(Description, 'build system')]");
|
2010-07-19 09:57:32 +00:00
|
|
|
|
2013-07-10 04:47:25 +00:00
|
|
|
if (build_tool)
|
|
|
|
std::cout << "Build tool: " << build_tool.node().attribute("Filename").value() << "\n";
|
2015-03-21 21:03:01 -07:00
|
|
|
// end::code[]
|
2010-07-19 09:57:32 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
// vim:et
|