Helper functions for extracting data from the TOML file
| 64 | |
| 65 | // Helper functions for extracting data from the TOML file |
| 66 | auto stringEntry(toml::table table, const std::string entry_name) -> QString |
| 67 | { |
| 68 | auto node = table[entry_name]; |
| 69 | if (!node) { |
| 70 | qCritical() << QString::fromStdString("Failed to read str property '" + entry_name + "' in mod metadata."); |
| 71 | return {}; |
| 72 | } |
| 73 | |
| 74 | return QString::fromStdString(node.value_or("")); |
| 75 | } |
| 76 | |
| 77 | auto intEntry(toml::table table, const std::string entry_name) -> int |
| 78 | { |