MCPcopy Create free account
hub / github.com/apache/trafficserver / yaml_load

Function yaml_load

plugins/experimental/txn_box/plugin/src/yaml_util.cc:74–97  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

72}
73
74Rv<YAML::Node>
75yaml_load(swoc::file::path const &path)
76{
77 // static_assert(sizeof(YAML::Node) == sizeof(static_cast<Rv<YAML::Node>*>(nullptr)->_r));
78 std::error_code ec;
79 std::string content = swoc::file::load(path, ec);
80
81 if (ec) {
82 return Errata(S_ERROR, R"(Unable to load file "{}" - {}.)", path, ec);
83 }
84
85 YAML::Node root;
86 try {
87 root = YAML::Load(content);
88 } catch (std::exception &ex) {
89 return Errata(S_ERROR, R"(YAML parsing of "{}" failed - {}.)", path, ex.what());
90 }
91
92 yaml_merge(root);
93 [[maybe_unused]] auto s1 = sizeof(Rv<YAML::Node>::result_type);
94 [[maybe_unused]] auto s2 = sizeof(YAML::Node);
95 static_assert(sizeof(Rv<YAML::Node>) > sizeof(YAML::Node));
96 return root;
97}

Callers 1

load_fileMethod · 0.85

Calls 5

ErrataClass · 0.85
LoadFunction · 0.85
yaml_mergeFunction · 0.85
loadFunction · 0.50
whatMethod · 0.45

Tested by

no test coverage detected