本文整理汇总了C++中XMLTag::GetAttributeValue方法的典型用法代码示例。如果您正苦于以下问题:C++ XMLTag::GetAttributeValue方法的具体用法?C++ XMLTag::GetAttributeValue怎么用?C++ XMLTag::GetAttributeValue使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类XMLTag
的用法示例。
在下文中一共展示了XMLTag::GetAttributeValue方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: GetEmbeddedTagByNameAndAttr
XMLTag* XMLTag::GetEmbeddedTagByNameAndAttr(const char* tagName, const char* attrName, const char* attrValue, const UInt32 index)
{
if (fEmbeddedTags.GetLength() <= index)
return NULL;
XMLTag* result = NULL;
UInt32 curIndex = 0;
for (OSQueueIter iter(&fEmbeddedTags); !iter.IsDone(); iter.Next())
{
XMLTag* temp = (XMLTag*)iter.GetCurrent()->GetEnclosingObject();
if (!strcmp(temp->GetTagName(), tagName) && (temp->GetAttributeValue(attrName) != NULL) &&
(!strcmp(temp->GetAttributeValue(attrName), attrValue)))
{
if (curIndex == index)
{
result = temp;
break;
}
curIndex++;
}
}
return result;
}
示例2: ParseRelayDestinations
void RCFSourceInfo::ParseRelayDestinations(XMLTag* relayTag)
{
// parse the NAME attribute of the relay tag and store it in the relayname attribute
char* name = relayTag->GetAttributeValue("NAME");
if (name != NULL)
{
fName = new char[::strlen(name) + 1];
::strcpy(fName, name);
}
UInt32 numTags = relayTag->GetNumEmbeddedTags();
AllocateOutputArray(numTags); // not all these are relay tags, but most are
// Now actually go through and figure out what to put into these OutputInfo structures,
// based on what's on the relay_destination line
fNumOutputs = 0;
for (UInt32 y = 0; y < numTags; y++)
{
XMLTag* destTag = relayTag->GetEmbeddedTagByNameAndAttr("OBJECT", "CLASS", "destination", y);
if (destTag == NULL)
return;
char* destType = destTag->GetAttributeValue("TYPE");
if (destType == NULL)
return;
if (!strcmp(destType, "udp_destination"))
ParseDestination(destTag, y);
else if (!strcmp(destType, "announced_destination"))
ParseAnnouncedDestination(destTag, y);
fNumOutputs++;
}
}