Core: XmlNode::HasTags

git-svn-id: svn://ultimatepp.org/upp/trunk@8913 f0d560ea-af0d-0410-9eb7-867de7ffcac7
This commit is contained in:
cxl 2015-09-10 18:39:14 +00:00
parent c766fc20a8
commit 3ffabbcb0c
3 changed files with 13 additions and 0 deletions

View file

@ -870,6 +870,14 @@ String XmlNode::GatherText() const
return r;
}
bool XmlNode::HasTags() const
{
for(int i = 0; i < GetCount(); i++)
if(node[i].IsTag())
return true;
return false;
}
int XmlNode::AttrInt(const char *id, int def) const
{
String x = Attr(id);

View file

@ -211,6 +211,7 @@ public:
String GatherText() const;
String operator~() const { return GatherText(); }
bool HasTags() const;
int GetAttrCount() const { return attr ? attr->GetCount() : 0; }
String AttrId(int i) const { return attr->GetKey(i); }

View file

@ -179,6 +179,10 @@ no such sub`-node, nothing happens.&]
[s2;%% Concatenates all XML`_TEXT sub`-nodes in order of increasing
indicies.&]
[s3;%% &]
[s4; &]
[s5;:Upp`:`:XmlNode`:`:HasTags`(`)const: [@(0.0.255) bool]_[* HasTags]()_[@(0.0.255) const]&]
[s2;%% Returns true if the node has subtags.&]
[s3; &]
[s4;%% &]
[s5;:XmlNode`:`:GetAttrCount`(`)const: [@(0.0.255) int]_[* GetAttrCount]()_[@(0.0.255) cons
t]&]