本文整理汇总了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));
}
示例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;
}
示例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();
}
}
}