| 226 | |
| 227 | template <typename T> |
| 228 | T IXmlNode::Attribute(const std::string& key, const T& def) const { |
| 229 | for (const auto &p : attribute_list_) { |
| 230 | if (Platform::stricmp(p.first.c_str(), key.c_str()) == 0) { |
| 231 | std::string v(p.second); |
| 232 | mdf::MdfHelper::Trim(v); |
| 233 | std::istringstream temp(v); |
| 234 | T out = {}; |
| 235 | temp >> out; |
| 236 | return out; |
| 237 | } |
| 238 | } |
| 239 | return def; |
| 240 | } |
| 241 | |
| 242 | template <> |
| 243 | inline bool IXmlNode::Attribute(const std::string& key, const bool& def) const { |