2008-07-01 10:28:10 +04:00
|
|
|
#include "parserstate.h"
|
|
|
|
|
|
|
|
|
|
namespace YAML
|
|
|
|
|
{
|
|
|
|
|
void ParserState::Reset()
|
|
|
|
|
{
|
|
|
|
|
// version
|
|
|
|
|
version.major = 1;
|
2008-07-02 09:00:32 +04:00
|
|
|
version.minor = 2;
|
2008-07-01 10:28:10 +04:00
|
|
|
|
|
|
|
|
// and tags
|
|
|
|
|
tags.clear();
|
|
|
|
|
tags["!"] = "!";
|
|
|
|
|
tags["!!"] = "tag:yaml.org,2002:";
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
std::string ParserState::TranslateTag(const std::string& handle) const
|
|
|
|
|
{
|
|
|
|
|
std::map <std::string, std::string>::const_iterator it = tags.find(handle);
|
|
|
|
|
if(it == tags.end())
|
|
|
|
|
return handle;
|
|
|
|
|
|
|
|
|
|
return it->second;
|
|
|
|
|
}
|
|
|
|
|
}
|