diff --git a/modules/stream_filter/dash/xml/DOMHelper.cpp b/modules/stream_filter/dash/xml/DOMHelper.cpp index 581bda59fbb93ab74a7f61ddd565bbf083cfd0f4..52f97dd126f08fc036a86f379eb43767f3a98659 100644 --- a/modules/stream_filter/dash/xml/DOMHelper.cpp +++ b/modules/stream_filter/dash/xml/DOMHelper.cpp @@ -40,6 +40,7 @@ std::vector<Node *> DOMHelper::getElementByTagName (Node *root, std::string return elements; } + std::vector<Node *> DOMHelper::getChildElementByTagName (Node *root, std::string name) { std::vector<Node *> elements; @@ -52,6 +53,7 @@ std::vector<Node *> DOMHelper::getChildElementByTagName (Node *root, std::string return elements; } + void DOMHelper::getElementsByTagName (Node *root, std::string name, std::vector<Node*> *elements, bool selfContain) { if(!selfContain && !root->getName().compare(name)) @@ -68,3 +70,13 @@ void DOMHelper::getElementsByTagName (Node *root, std::string getElementsByTagName(root->getSubNodes().at(i), name, elements, selfContain); } } + +Node* DOMHelper::getFirstChildElementByName( Node *root, const std::string &name ) +{ + for(size_t i = 0; i < root->getSubNodes().size(); i++) + { + if( !root->getSubNodes().at( i )->getName().compare( name ) ) + return root->getSubNodes().at( i ); + } + return NULL; +} diff --git a/modules/stream_filter/dash/xml/DOMHelper.h b/modules/stream_filter/dash/xml/DOMHelper.h index 75a93bbe571240bc4f1fd9f81c922bbc23756068..775b8f34ba089c89f4d3f95960bf22844d1e669b 100644 --- a/modules/stream_filter/dash/xml/DOMHelper.h +++ b/modules/stream_filter/dash/xml/DOMHelper.h @@ -39,6 +39,7 @@ namespace dash public: static std::vector<Node *> getElementByTagName (Node *root, std::string name, bool selfContain); static std::vector<Node *> getChildElementByTagName (Node *root, std::string name); + static Node* getFirstChildElementByName( Node *root, const std::string& name ); private: static void getElementsByTagName(Node *root, std::string name, std::vector<Node *> *elements, bool selfContain);