From ae548516fade46a267420d745694e02976160ab1 Mon Sep 17 00:00:00 2001 From: Carl Hetherington Date: Fri, 22 Dec 2023 16:55:57 +0100 Subject: [PATCH] Add Node::is_text(). --- src/cxml.cc | 7 +++++++ src/cxml.h | 2 ++ 2 files changed, 9 insertions(+) diff --git a/src/cxml.cc b/src/cxml.cc index b065b37..7096f71 100644 --- a/src/cxml.cc +++ b/src/cxml.cc @@ -248,6 +248,13 @@ cxml::Node::namespace_prefix () const return _node->get_namespace_prefix (); } + +bool +cxml::Node::is_text() const +{ + return dynamic_cast(_node); +} + cxml::Document::Document (string root_name) : _root_name (root_name) { diff --git a/src/cxml.h b/src/cxml.h index 9a71889..713e9af 100644 --- a/src/cxml.h +++ b/src/cxml.h @@ -231,6 +231,8 @@ public: return _node; } + bool is_text() const; + protected: xmlpp::Node* _node; -- 2.30.2