return a map of all path in runroot.yaml
| 237 | |
| 238 | // return a map of all path in runroot.yaml |
| 239 | RunrootMapType |
| 240 | runroot_map(const std::string &file) |
| 241 | { |
| 242 | RunrootMapType map; |
| 243 | try { |
| 244 | YAML::Node yamlfile = YAML::LoadFile(file); |
| 245 | std::string prefix = file.substr(0, file.find_last_of('/')); |
| 246 | |
| 247 | for (const auto &it : yamlfile) { |
| 248 | // key value pairs of dirs |
| 249 | std::string value = it.second.as<std::string>(); |
| 250 | if (value[0] != '/') { |
| 251 | value = Layout::relative_to(prefix, value); |
| 252 | } |
| 253 | map[it.first.as<std::string>()] = value; |
| 254 | } |
| 255 | } catch (YAML::Exception &e) { |
| 256 | ink_warning("Unable to read '%s': %s", file.c_str(), e.what()); |
| 257 | ink_notice("Continuing with default value"); |
| 258 | return RunrootMapType{}; |
| 259 | } |
| 260 | return map; |
| 261 | } |
| 262 | |
| 263 | // check for the using of runroot |
| 264 | // a map of all path will be returned |
no test coverage detected