MCPcopy Create free account
hub / github.com/N64Recomp/N64Recomp / get_manual_funcs

Function get_manual_funcs

src/config.cpp:15–39  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

13}
14
15std::vector<N64Recomp::ManualFunction> get_manual_funcs(const toml::array* manual_funcs_array) {
16 std::vector<N64Recomp::ManualFunction> ret;
17
18 // Reserve room for all the funcs in the map.
19 ret.reserve(manual_funcs_array->size());
20 manual_funcs_array->for_each([&ret](auto&& el) {
21 if constexpr (toml::is_table<decltype(el)>) {
22 std::optional<std::string> func_name = el["name"].template value<std::string>();
23 std::optional<std::string> section_name = el["section"].template value<std::string>();
24 std::optional<uint32_t> vram_in = el["vram"].template value<uint32_t>();
25 std::optional<uint32_t> size = el["size"].template value<uint32_t>();
26
27 if (func_name.has_value() && section_name.has_value() && vram_in.has_value() && size.has_value()) {
28 ret.emplace_back(func_name.value(), section_name.value(), vram_in.value(), size.value());
29 } else {
30 throw toml::parse_error("Missing required value in manual_funcs array", el.source());
31 }
32 }
33 else {
34 throw toml::parse_error("Missing required value in manual_funcs array", el.source());
35 }
36 });
37
38 return ret;
39}
40
41std::vector<std::filesystem::path> get_data_syms_paths(const toml::array* data_syms_paths_array, const std::filesystem::path& basedir) {
42 std::vector<std::filesystem::path> ret;

Callers 1

ConfigMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected