Browse Source

move getTagNodeNameValue here

master
Odilitime 5 years ago
parent
commit
e12c2b4784
  1. 12
      src/html/TagNode.cpp
  2. 1
      src/html/TagNode.h

12
src/html/TagNode.cpp

@ -21,3 +21,15 @@ std::vector<std::string> TagNode::getSourceList() { @@ -21,3 +21,15 @@ std::vector<std::string> TagNode::getSourceList() {
return returnVec;
}
std::unique_ptr<std::pair<std::string, std::string>> TagNode::getTagNodeNameValue() {
auto namePropIter = this->properties.find("name");
if (namePropIter == this->properties.end()) {
return nullptr;
}
auto valuePropIter = this->properties.find("value");
if (valuePropIter == this->properties.end()) {
return nullptr;
}
return std::make_unique<std::pair<std::string, std::string>>(namePropIter->second, valuePropIter->second);
}

1
src/html/TagNode.h

@ -11,6 +11,7 @@ public: @@ -11,6 +11,7 @@ public:
std::map<std::string, std::string> properties;
std::vector<std::string> getSourceList() override;
std::unique_ptr<std::pair<std::string, std::string>> getTagNodeNameValue();
};
#endif

Loading…
Cancel
Save