Simple version of toml reader

This commit is contained in:
jmsgrogan 2022-10-11 19:39:14 +01:00
parent 70991e59af
commit 48d21b9194
2 changed files with 91 additions and 25 deletions

View file

@ -1,14 +1,21 @@
#include "TomlReader.h"
#include <filesystem>
#include <iostream>
int main()
{
const auto data_loc = std::filesystem::path(__FILE__) / "../data";
const auto data_loc = std::filesystem::path(__FILE__) / "../../data";
const auto sample_toml_file = data_loc / "sample_toml.toml";
auto reader = TomlReader();
reader.read(sample_toml_file);
auto themes_table = reader.getContent()->getTable("themes");
for (const auto& items : themes_table->getKeyValuePairs())
{
std::cout << "Got entry with key: " << items.first << " and val " << items.second << std::endl;
}
return 0;
}