yaml-cpp/src/directives.cpp

23 lines
467 B
C++
Raw Normal View History

#include "directives.h"
2014-03-22 21:49:16 +04:00
namespace YAML {
Directives::Directives() : version{true, 1, 2}, tags{} {
/* Version:
** bool isDefault;
** int major, minor;
*/
2014-03-22 21:49:16 +04:00
}
2014-03-24 05:08:54 +04:00
const std::string Directives::TranslateTagHandle(
const std::string& handle) const {
2014-03-22 21:49:16 +04:00
std::map<std::string, std::string>::const_iterator it = tags.find(handle);
if (it == tags.end()) {
if (handle == "!!")
return "tag:yaml.org,2002:";
return handle;
}
return it->second;
}
}