Merged r295:305 from the tags branch to the trunk

This commit is contained in:
Jesse Beder
2009-10-29 15:48:06 +00:00
parent fe57829aca
commit a372bfdc60
27 changed files with 973 additions and 145 deletions

View File

@@ -2,23 +2,22 @@
namespace YAML
{
void ParserState::Reset()
ParserState::ParserState()
{
// version
version.isDefault = true;
version.major = 1;
version.minor = 2;
// and tags
tags.clear();
tags["!"] = "!";
tags["!!"] = "tag:yaml.org,2002:";
}
std::string ParserState::TranslateTag(const std::string& handle) const
const std::string ParserState::TranslateTagHandle(const std::string& handle) const
{
std::map <std::string, std::string>::const_iterator it = tags.find(handle);
if(it == tags.end())
if(it == tags.end()) {
if(handle == "!!")
return "tag:yaml.org,2002:";
return handle;
}
return it->second;
}