From df818f4d269d58a9bb43de0ec629b095db9f88fa Mon Sep 17 00:00:00 2001 From: paulc Date: Thu, 15 Dec 2011 15:55:59 +0000 Subject: [PATCH] Added helper method to check if an XmlParent has any children. git-svn-id: http://yate.null.ro/svn/yate/trunk@4765 acf43c95-373e-0410-b603-e72c3f656dc1 --- libs/yxml/yatexml.h | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/libs/yxml/yatexml.h b/libs/yxml/yatexml.h index 4ec9d794..2a335b94 100644 --- a/libs/yxml/yatexml.h +++ b/libs/yxml/yatexml.h @@ -576,6 +576,13 @@ public: */ virtual void clearChildren() { } + + /** + * Check if at least one child element exists + * @return True if this parent has at least one child + */ + inline bool hasChildren() const + { return getChildren().skipNull() != 0; } }; /**