Skip to content
This repository has been archived by the owner on Aug 27, 2024. It is now read-only.

Commit

Permalink
adding function for more easily retrieving element
Browse files Browse the repository at this point in the history
  • Loading branch information
wtbarnes committed Sep 7, 2016
1 parent 3563616 commit 0f48c8b
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
7 changes: 7 additions & 0 deletions source/xmlreader.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,13 @@ std::string get_element_text(tinyxml2::XMLElement *root,std::string search_value
return checked_result->GetText();
}

tinyxml2::XMLElement * get_element(tinyxml2::XMLElement *root,std::string search_value)
{
tinyxml2::XMLElement * result = recursive_read(root,search_value);
tinyxml2::XMLElement * checked_result = check_element(result,search_value);
return checked_result;
}

tinyxml2::XMLElement * check_element(tinyxml2::XMLElement *result,std::string search_value)
{
if(result != NULL)
Expand Down
1 change: 1 addition & 0 deletions source/xmlreader.h
Original file line number Diff line number Diff line change
Expand Up @@ -13,5 +13,6 @@
#include "../tinyxml2/tinyxml2.h"

std::string get_element_text(tinyxml2::XMLElement *, std::string);
tinyxml2::XMLElement * get_element(tinyxml2::XMLElement *, std::string);
tinyxml2::XMLElement * recursive_read(tinyxml2::XMLElement *, std::string);
tinyxml2::XMLElement * check_element(tinyxml2::XMLElement *, std::string);

0 comments on commit 0f48c8b

Please sign in to comment.