]> git.sesse.net Git - vlc/commitdiff
dash: node added hasattribute
authorChristopher Mueller <christopher.mueller@itec.aau.at>
Mon, 30 Jan 2012 13:48:22 +0000 (14:48 +0100)
committerHugo Beauzée-Luyssen <beauze.h@gmail.com>
Thu, 2 Feb 2012 11:27:26 +0000 (12:27 +0100)
Signed-off-by: Hugo Beauzée-Luyssen <beauze.h@gmail.com>
modules/stream_filter/dash/xml/Node.cpp
modules/stream_filter/dash/xml/Node.h

index 8e90e7e15846887fd4a108076871315ec0f7d58e..87f4f95e4f74d4fb2a3ac9e40fe9bd8383476174 100644 (file)
@@ -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 );
index f11662f8854a28e2136579eded3c3a76beb2921f..1d667de101c3b94c3a1a7384c538ff32c34b2bdd 100644 (file)
@@ -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;