本文整理汇总了C++中xml::Node::getAttributeValue方法的典型用法代码示例。如果您正苦于以下问题:C++ Node::getAttributeValue方法的具体用法?C++ Node::getAttributeValue怎么用?C++ Node::getAttributeValue使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类xml::Node
的用法示例。
在下文中一共展示了Node::getAttributeValue方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: getCondition
MouseEventManager::ConditionStruc MouseEventManager::getCondition (xml::Node node)
{
const std::string button = node.getAttributeValue("button");
const std::string modifiers = node.getAttributeValue("modifiers");
const std::string minSelectionCount = node.getAttributeValue("minSelectionCount");
ConditionStruc returnValue;
returnValue.buttonId = getButtonId(button);
returnValue.modifierFlags = _modifiers.getModifierFlags(modifiers);
returnValue.minSelectionCount = string::toInt(minSelectionCount, DEFAULT_MIN_SELECTION_COUNT);
return returnValue;
}
示例2: getCondition
MouseEventManager::ConditionStruc MouseEventManager::getCondition(const xml::Node& node)
{
const std::string button = node.getAttributeValue("button");
const std::string modifiers = node.getAttributeValue("modifiers");
const std::string minSelectionCount = node.getAttributeValue("minSelectionCount");
ConditionStruc returnValue;
returnValue.buttonId = getButtonId(button);
returnValue.modifierFlags = _modifiers.getModifierFlags(modifiers);
try {
returnValue.minSelectionCount = boost::lexical_cast<int>(minSelectionCount);
}
catch (boost::bad_lexical_cast e) {
returnValue.minSelectionCount = DEFAULT_MIN_SELECTION_COUNT;
}
return returnValue;
}
示例3: 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";
}
}
示例4: loadFromNode
void PanedPosition::loadFromNode(xml::Node node) {
_position = string::toInt(node.getAttributeValue("position"));
}