Added overload for operator [] for char * (non-const version)

This commit is contained in:
Jesse Beder
2011-09-06 00:32:53 -05:00
parent 7e129c9b64
commit fadca5a89d
3 changed files with 27 additions and 0 deletions

View File

@@ -77,7 +77,9 @@ namespace YAML
// specific to maps
const Node *FindValue(const char *key) const;
const Node *FindValue(char *key) const;
const Node& operator [] (const char *key) const;
const Node& operator [] (char *key) const;
// for tags
const std::string& Tag() const { return m_tag; }

View File

@@ -68,10 +68,18 @@ namespace YAML
inline const Node *Node::FindValue(const char *key) const {
return FindValue(std::string(key));
}
inline const Node *Node::FindValue(char *key) const {
return FindValue(std::string(key));
}
inline const Node& Node::operator [] (const char *key) const {
return GetValue(std::string(key));
}
inline const Node& Node::operator [] (char *key) const {
return GetValue(std::string(key));
}
}
#endif // NODEIMPL_H_62B23520_7C8E_11DE_8A39_0800200C9A66