2010-10-18 10:45:03 +04:00
|
|
|
#include "directives.h"
|
2008-09-04 02:20:39 +04:00
|
|
|
|
|
|
|
|
namespace YAML
|
|
|
|
|
{
|
2010-10-18 10:45:03 +04:00
|
|
|
Directives::Directives()
|
2008-09-04 02:20:39 +04:00
|
|
|
{
|
|
|
|
|
// version
|
2009-10-29 18:48:06 +03:00
|
|
|
version.isDefault = true;
|
2008-09-04 02:20:39 +04:00
|
|
|
version.major = 1;
|
|
|
|
|
version.minor = 2;
|
|
|
|
|
}
|
2010-10-18 10:45:03 +04:00
|
|
|
|
|
|
|
|
const std::string Directives::TranslateTagHandle(const std::string& handle) const
|
2008-09-04 02:20:39 +04:00
|
|
|
{
|
|
|
|
|
std::map <std::string, std::string>::const_iterator it = tags.find(handle);
|
2009-10-29 18:48:06 +03:00
|
|
|
if(it == tags.end()) {
|
|
|
|
|
if(handle == "!!")
|
|
|
|
|
return "tag:yaml.org,2002:";
|
2008-09-04 02:20:39 +04:00
|
|
|
return handle;
|
2009-10-29 18:48:06 +03:00
|
|
|
}
|
2010-10-18 10:45:03 +04:00
|
|
|
|
2008-09-04 02:20:39 +04:00
|
|
|
return it->second;
|
|
|
|
|
}
|
|
|
|
|
}
|