diff --git a/include/yaml-cpp/exceptions.h b/include/yaml-cpp/exceptions.h index f60b67f..c3f4474 100644 --- a/include/yaml-cpp/exceptions.h +++ b/include/yaml-cpp/exceptions.h @@ -100,6 +100,12 @@ inline const std::string KEY_NOT_FOUND_WITH_KEY(const std::string& key) { return stream.str(); } +inline const std::string KEY_NOT_FOUND_WITH_KEY(const char* key) { + std::stringstream stream; + stream << KEY_NOT_FOUND << ": " << key; + return stream.str(); +} + template inline const std::string KEY_NOT_FOUND_WITH_KEY( const T& key, typename enable_if>::type* = 0) { @@ -120,6 +126,12 @@ inline const std::string BAD_SUBSCRIPT_WITH_KEY(const std::string& key) { return stream.str(); } +inline const std::string BAD_SUBSCRIPT_WITH_KEY(const char* key) { + std::stringstream stream; + stream << BAD_SUBSCRIPT << " (key: \"" << key << "\")"; + return stream.str(); +} + template inline const std::string BAD_SUBSCRIPT_WITH_KEY( const T& key, typename enable_if>::type* = nullptr) {