Refactored the operator >> and Node::Read default functions, as well as the conversion functions, to more easily read new types as keys (this uncovered an error, in example 2.11 of the spec)

This commit is contained in:
Jesse Beder
2009-09-06 20:52:45 +00:00
parent 9a1f4f9a0d
commit e7ac6b3bf1
6 changed files with 137 additions and 41 deletions

View File

@@ -49,8 +49,7 @@ namespace
namespace YAML
{
template <>
bool Converter<bool>::Convert(const std::string& input, bool& b)
bool Convert(const std::string& input, bool& b)
{
// we can't use iostream bool extraction operators as they don't
// recognize all possible values in the table below (taken from
@@ -82,8 +81,7 @@ namespace YAML
return false;
}
template <>
bool Converter<_Null>::Convert(const std::string& input, _Null& /*output*/)
bool Convert(const std::string& input, _Null& /*output*/)
{
return input.empty() || input == "~" || input == "null" || input == "Null" || input == "NULL";
}