[vlc-commits] dash: node added hasattribute

Christopher Mueller git at videolan.org
Thu Feb 2 12:33:24 CET 2012


vlc | branch: master | Christopher Mueller <christopher.mueller at itec.aau.at> | Mon Jan 30 14:48:22 2012 +0100| [d20d8bd9604a5f80a0392e56e8947e0ca7047daf] | committer: Hugo Beauzée-Luyssen

dash: node added hasattribute

Signed-off-by: Hugo Beauzée-Luyssen <beauze.h at gmail.com>

> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=d20d8bd9604a5f80a0392e56e8947e0ca7047daf
---

 modules/stream_filter/dash/xml/Node.cpp |    9 ++++++++-
 modules/stream_filter/dash/xml/Node.h   |    1 +
 2 files changed, 9 insertions(+), 1 deletions(-)

diff --git a/modules/stream_filter/dash/xml/Node.cpp b/modules/stream_filter/dash/xml/Node.cpp
index 8e90e7e..87f4f95 100644
--- a/modules/stream_filter/dash/xml/Node.cpp
+++ b/modules/stream_filter/dash/xml/Node.cpp
@@ -45,7 +45,7 @@ Node::~Node ()
         delete(this->subNodes.at(i));
 }
 
-const std::vector<Node*>&            Node::getSubNodes           () const
+const std::vector<Node*>&           Node::getSubNodes           () const
 {
     return this->subNodes;
 }
@@ -62,6 +62,13 @@ void                                Node::setName               (const std::stri
     this->name = name;
 }
 
+bool                                Node::hasAttribute        (const std::string& name)
+{
+    if(this->attributes.find(name) != this->attributes.end())
+        return true;
+
+    return false;
+}
 const std::string&                  Node::getAttributeValue     (const std::string& key) const
 {
     std::map<std::string, std::string>::const_iterator  it = this->attributes.find( key );
diff --git a/modules/stream_filter/dash/xml/Node.h b/modules/stream_filter/dash/xml/Node.h
index f11662f..1d667de 100644
--- a/modules/stream_filter/dash/xml/Node.h
+++ b/modules/stream_filter/dash/xml/Node.h
@@ -44,6 +44,7 @@ namespace dash
                 void                                addSubNode          (Node *node);
                 const std::string&                  getName             () const;
                 void                                setName             (const std::string& name);
+                bool                                hasAttribute        (const std::string& name);
                 void                                addAttribute        (const std::string& key, const std::string& value);
                 const std::string&                  getAttributeValue   (const std::string& key) const;
                 std::vector<std::string>            getAttributeKeys    () const;



More information about the vlc-commits mailing list