本文整理汇总了C++中xml::Node::getNamedChildren方法的典型用法代码示例。如果您正苦于以下问题:C++ Node::getNamedChildren方法的具体用法?C++ Node::getNamedChildren怎么用?C++ Node::getNamedChildren使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类xml::Node
的用法示例。
在下文中一共展示了Node::getNamedChildren方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: ColourItem
/* ColourScheme Constructor
* Builds the colourscheme structure and passes the found <colour> tags to the ColourItem constructor
* All the found <colour> items are stored in a vector of ColourItems
*/
ColourScheme::ColourScheme(xml::Node& schemeNode) {
_readOnly = (schemeNode.getAttributeValue("readonly") == "1");
// Select all <colour> nodes from the tree
xml::NodeList colourNodes = schemeNode.getNamedChildren("colour");
if (colourNodes.size() > 0) {
// Assign the name of this scheme
_name = schemeNode.getAttributeValue("name");
// Cycle through all found colour tags and add them to this scheme
for (unsigned int i = 0; i < colourNodes.size(); i++) {
std::string colourName = colourNodes[i].getAttributeValue("name");
_colours[colourName] = ColourItem(colourNodes[i]);
}
}
else {
globalOutputStream() << "ColourScheme: No scheme items found.\n";
}
}