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


C++ Node::getAttributeValue方法代码示例

本文整理汇总了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;
}
开发者ID:AresAndy,项目名称:ufoai,代码行数:14,代码来源:MouseEvents.cpp

示例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;
}
开发者ID:nbohr1more,项目名称:DarkRadiant,代码行数:20,代码来源:MouseEvents.cpp

示例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";
	}
}
开发者ID:AresAndy,项目名称:ufoai,代码行数:25,代码来源:ColourScheme.cpp

示例4: loadFromNode

void PanedPosition::loadFromNode(xml::Node node) {
	_position = string::toInt(node.getAttributeValue("position"));
}
开发者ID:chrisglass,项目名称:ufoai,代码行数:3,代码来源:PanedPosition.cpp


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