[vlc-devel] [PATCH 04/17] dash: node added hasattribute
Christopher at mailsrv.uni-klu.ac.at
Christopher at mailsrv.uni-klu.ac.at
Mon Jan 30 14:48:22 CET 2012
From: Christopher Mueller <christopher.mueller at itec.aau.at>
---
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;
--
1.7.0.4
More information about the vlc-devel
mailing list