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


C++ XmlAttribute::GetValue方法代码示例

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


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

示例1: testEmpty

void XmlAttributeUnitTests::testEmpty()
{
	XmlAttribute attr;
	CPPUNIT_ASSERT(attr.GetValue().empty());
	CPPUNIT_ASSERT(false == attr.GetBoolValue(false));
	CPPUNIT_ASSERT(true == attr.GetBoolValue(true));
}
开发者ID:AllanDragoon,项目名称:dotnetinstaller,代码行数:7,代码来源:XmlAttributeUnitTests.cpp

示例2: _readNodeCallback

bool OpenOfficeAction::_readNodeCallback(XmlNode node, void *data)
{
	vector <XmlAttribute>* attributes;
	bool bIsItem;

	if (parsing_state == PropUILocale && node.GetName().compare(L"value")==0)
	{		
		wstring* lang_found = (wstring *) data;
		*lang_found = node.GetText();
		parsing_state = ItemOther;
		return false;
	}

	bIsItem = node.GetName().compare(L"item") == 0;

	if (bIsItem && parsing_state != ItemOther)
	{
		parsing_state = ItemOther;
	}	

	attributes = node.GetAttributes();
	for (unsigned int i = 0; i < attributes->size(); i++)
	{
		XmlAttribute attribute;

		attribute = attributes->at(i);

		if (parsing_state == ItemOther && bIsItem && attribute.GetName() == L"oor:path" && attribute.GetValue() == L"/org.openoffice.Office.Linguistic/General")
		{
			parsing_state = ItemLinguisticGeneral;			
		}

		if (parsing_state == ItemLinguisticGeneral && attribute.GetName() == L"oor:name" && attribute.GetValue() == L"UILocale")
		{
			parsing_state = PropUILocale;
		}
	}
	
	return true;
}
开发者ID:NoAntzWk,项目名称:CatalanitzadorPerAWindows,代码行数:40,代码来源:OpenOfficeAction.cpp

示例3: OnParse

//[-------------------------------------------------------]
//[ Protected virtual XmlTextElement functions            ]
//[-------------------------------------------------------]
void XmlTextImage::OnParse(XmlNode &cXmlNode)
{
	// Is this an XML element?
	if (cXmlNode.GetType() == XmlNode::Element) {
		// Destroy the previous image
		if (m_pImage) {
			delete m_pImage;
			m_pImage = nullptr;
		}

		// Get XML element
		XmlElement &cXmlElement = static_cast<XmlElement&>(cXmlNode);

		// Parse attributes
		XmlAttribute *pAttribute = cXmlElement.GetFirstAttribute();
		while (pAttribute) {
			// Get name and value
			String sName  = pAttribute->GetName();
			String sValue = pAttribute->GetValue();

			// Save attribute
			if (sName.CompareNoCase("Src")) {
				// Image filename
				m_sFilename = sValue;
			} else if (sName.CompareNoCase("Width")) {
				// Image width
				m_vSize.x = sValue.GetInt();
			} if (sName.CompareNoCase("Height")) {
				// Image height
				m_vSize.y = sValue.GetInt();
			}

			// Next attribute
			pAttribute = pAttribute->GetNext();
		}

	}
}
开发者ID:ByeDream,项目名称:pixellight,代码行数:41,代码来源:XmlTextImage.cpp


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