directives.cpp 455 B

12345678910111213141516171819202122
  1. #include "directives.h"
  2. namespace YAML {
  3. Directives::Directives() {
  4. // version
  5. version.isDefault = true;
  6. version.major = 1;
  7. version.minor = 2;
  8. }
  9. const std::string Directives::TranslateTagHandle(
  10. const std::string& handle) const {
  11. std::map<std::string, std::string>::const_iterator it = tags.find(handle);
  12. if (it == tags.end()) {
  13. if (handle == "!!")
  14. return "tag:yaml.org,2002:";
  15. return handle;
  16. }
  17. return it->second;
  18. }
  19. }