"configs/vscode:/vscode.git/clone" did not exist on "1c95790fdd7cda216935ff62f1badf1a6381e82c"
directives.cpp 420 Bytes
Newer Older
1
#include "directives.h"
2

Jesse Beder's avatar
Jesse Beder committed
3
namespace YAML {
4
Directives::Directives() : version{true, 1, 2}, tags{} {}
Jesse Beder's avatar
Jesse Beder committed
5

Jesse Beder's avatar
Jesse Beder committed
6
7
const std::string Directives::TranslateTagHandle(
    const std::string& handle) const {
Jesse Beder's avatar
Jesse Beder committed
8
9
10
11
12
13
14
15
16
  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;
}
17
}  // namespace YAML