28
tinyxml2.cpp
28
tinyxml2.cpp
@@ -822,6 +822,34 @@ XMLNode::~XMLNode()
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// ChildElementCount was originally suggested by msteiger on the sourceforge page for TinyXML and modified by KB1SPH for TinyXML-2.
|
||||||
|
|
||||||
|
int XMLNode::ChildElementCount(const char *value) const {
|
||||||
|
int count = 0;
|
||||||
|
|
||||||
|
const XMLElement *e = FirstChildElement(value);
|
||||||
|
|
||||||
|
while (e) {
|
||||||
|
e = e->NextSiblingElement(value);
|
||||||
|
count++;
|
||||||
|
}
|
||||||
|
|
||||||
|
return count;
|
||||||
|
}
|
||||||
|
|
||||||
|
int XMLNode::ChildElementCount() const {
|
||||||
|
int count = 0;
|
||||||
|
|
||||||
|
const XMLElement *e = FirstChildElement();
|
||||||
|
|
||||||
|
while (e) {
|
||||||
|
e = e->NextSiblingElement();
|
||||||
|
count++;
|
||||||
|
}
|
||||||
|
|
||||||
|
return count;
|
||||||
|
}
|
||||||
|
|
||||||
const char* XMLNode::Value() const
|
const char* XMLNode::Value() const
|
||||||
{
|
{
|
||||||
// Edge case: XMLDocuments don't have a Value. Return null.
|
// Edge case: XMLDocuments don't have a Value. Return null.
|
||||||
|
|||||||
@@ -732,6 +732,12 @@ public:
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// ChildElementCount was originally suggested by msteiger on the sourceforge page for TinyXML and modified by KB1SPH for TinyXML-2.
|
||||||
|
|
||||||
|
int ChildElementCount(const char *value) const;
|
||||||
|
|
||||||
|
int ChildElementCount() const;
|
||||||
|
|
||||||
/** The meaning of 'value' changes for the specific type.
|
/** The meaning of 'value' changes for the specific type.
|
||||||
@verbatim
|
@verbatim
|
||||||
Document: empty (NULL is returned, not an empty string)
|
Document: empty (NULL is returned, not an empty string)
|
||||||
|
|||||||
Reference in New Issue
Block a user