Skip to content

Commit

Permalink
Unused function
Browse files Browse the repository at this point in the history
  • Loading branch information
dirkvdb committed Aug 28, 2024
1 parent f878996 commit 14aea0d
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 17 deletions.
2 changes: 1 addition & 1 deletion deps/geodynamix
32 changes: 16 additions & 16 deletions logic/configurationparser.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -550,22 +550,22 @@ static std::vector<Pollutant> read_pollutants(toml::node_view<const toml::node>
return result;
}

static std::string read_string(const NamedSection& ns, std::string_view name)
{
assert(ns.section.is_table());
auto nodeValue = ns.section[name];

if (!nodeValue) {
throw RuntimeError("'{}' key not present in {} section", name, ns.name);
}

if (!nodeValue.is_string()) {
throw RuntimeError("'{0:}' key value in '{1:}' section should be a quoted string (e.g. {0:} = \"value\")", name, ns.name);
}

assert(nodeValue.value<std::string>().has_value());
return nodeValue.value<std::string>().value();
}
// static std::string read_string(const NamedSection& ns, std::string_view name)
// {
// assert(ns.section.is_table());
// auto nodeValue = ns.section[name];

// if (!nodeValue) {
// throw RuntimeError("'{}' key not present in {} section", name, ns.name);
// }

// if (!nodeValue.is_string()) {
// throw RuntimeError("'{0:}' key value in '{1:}' section should be a quoted string (e.g. {0:} = \"value\")", name, ns.name);
// }

// assert(nodeValue.value<std::string>().has_value());
// return nodeValue.value<std::string>().value();
// }

static std::string read_string(const NamedSection& ns, std::string_view name, std::string_view defaultValue)
{
Expand Down

0 comments on commit 14aea0d

Please sign in to comment.