yaml-cpp/src/directives.cpp

18 lines
374 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{} {}
2014-03-22 21:49:16 +04:00
2022-06-01 01:14:59 +03:00
const std::string Directives::TranslateTagHandle(
2014-03-24 05:08:54 +04:00
const std::string& handle) const {
auto it = tags.find(handle);
2014-03-22 21:49:16 +04:00
if (it == tags.end()) {
if (handle == "!!")
2022-06-01 01:14:59 +03:00
return "tag:yaml.org,2002:";
return handle;
2014-03-22 21:49:16 +04:00
}
2022-06-01 01:14:59 +03:00
return it->second;
2014-03-22 21:49:16 +04:00
}
} // namespace YAML