mirror of
https://github.com/wheremyfoodat/Panda3DS.git
synced 2025-04-07 22:55:40 +12:00
peeve: guarantee toml order (#451)
This commit is contained in:
parent
498d19fa51
commit
ff1eaed0a4
1 changed files with 3 additions and 2 deletions
|
@ -2,6 +2,7 @@
|
||||||
|
|
||||||
#include <cmath>
|
#include <cmath>
|
||||||
#include <fstream>
|
#include <fstream>
|
||||||
|
#include <map>
|
||||||
#include <string>
|
#include <string>
|
||||||
|
|
||||||
#include "helpers.hpp"
|
#include "helpers.hpp"
|
||||||
|
@ -99,13 +100,13 @@ void EmulatorConfig::load() {
|
||||||
}
|
}
|
||||||
|
|
||||||
void EmulatorConfig::save() {
|
void EmulatorConfig::save() {
|
||||||
toml::basic_value<toml::preserve_comments> data;
|
toml::basic_value<toml::preserve_comments, std::map> data;
|
||||||
const std::filesystem::path& path = filePath;
|
const std::filesystem::path& path = filePath;
|
||||||
|
|
||||||
std::error_code error;
|
std::error_code error;
|
||||||
if (std::filesystem::exists(path, error)) {
|
if (std::filesystem::exists(path, error)) {
|
||||||
try {
|
try {
|
||||||
data = toml::parse<toml::preserve_comments>(path);
|
data = toml::parse<toml::preserve_comments, std::map>(path);
|
||||||
} catch (const std::exception& ex) {
|
} catch (const std::exception& ex) {
|
||||||
Helpers::warn("Exception trying to parse config file. Exception: %s\n", ex.what());
|
Helpers::warn("Exception trying to parse config file. Exception: %s\n", ex.what());
|
||||||
return;
|
return;
|
||||||
|
|
Loading…
Add table
Reference in a new issue