diff options
author | crupest <crupest@outlook.com> | 2022-03-05 21:45:33 +0800 |
---|---|---|
committer | crupest <crupest@outlook.com> | 2022-03-05 21:45:33 +0800 |
commit | 7697f1ca3904301e551e7500089b30034e84eb32 (patch) | |
tree | 2f9e763d96df0679ea3582721f5a109750694d9b /include | |
parent | 221f9cd7e453f2968c12a14a46588ea50ca2119d (diff) | |
download | cru-7697f1ca3904301e551e7500089b30034e84eb32.tar.gz cru-7697f1ca3904301e551e7500089b30034e84eb32.tar.bz2 cru-7697f1ca3904301e551e7500089b30034e84eb32.zip |
...
Diffstat (limited to 'include')
-rw-r--r-- | include/cru/xml/XmlNode.h | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/include/cru/xml/XmlNode.h b/include/cru/xml/XmlNode.h index 2f46459a..50685749 100644 --- a/include/cru/xml/XmlNode.h +++ b/include/cru/xml/XmlNode.h @@ -97,11 +97,13 @@ class CRU_XML_API XmlElementNode : public XmlNode { const std::vector<XmlNode*> GetChildren() const { return children_; } Index GetChildCount() const { return children_.size(); } - String GetAttribute(const String& key) const { return attributes_.at(key); } - String GetAttributeCaseInsensitive(const String& key) const { - return *GetOptionalAttributeCaseInsensitive(key); + String GetAttributeValue(const String& key) const { + return attributes_.at(key); } - std::optional<String> GetOptionalAttribute(const String& key) const { + String GetAttributeValueCaseInsensitive(const String& key) const { + return *GetOptionalAttributeValueCaseInsensitive(key); + } + std::optional<String> GetOptionalAttributeValue(const String& key) const { auto it = attributes_.find(key); if (it == attributes_.end()) { return std::nullopt; @@ -109,7 +111,7 @@ class CRU_XML_API XmlElementNode : public XmlNode { return it->second; } - std::optional<String> GetOptionalAttributeCaseInsensitive( + std::optional<String> GetOptionalAttributeValueCaseInsensitive( const String& key) const { for (auto it = attributes_.begin(); it != attributes_.end(); ++it) { if (it->first.CaseInsensitiveCompare(key) == 0) { |