Function utils::parseTOMLFile

Function Documentation

inline auto utils::parseTOMLFile(const std::string &fileName, const std::string &context) -> std::pair<toml::table, std::filesystem::path>

Locate and parse a TOML file.

Parameters:
  • fileName – Name of the file to locate (via utils::getFilePath) and parse

  • context – Prefix used in thrown error messages (typically the name of the calling class or function)

Throws:

std::runtime_error – if fileName cannot be located via utils::getFilePath, or the file it resolves to cannot be parsed as toml

Returns:

The parsed toml table and the path it was read from