Browse Source

move getTagNodeNameValue here

master
Odilitime 4 years ago
parent
commit
e12c2b4784
2 changed files with 13 additions and 0 deletions
  1. 12
    0
      src/html/TagNode.cpp
  2. 1
    0
      src/html/TagNode.h

+ 12
- 0
src/html/TagNode.cpp View File

@@ -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
- 0
src/html/TagNode.h View File

@@ -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