stuff-from-scratch/test/core/TestTomlReader.cpp

21 lines
516 B
C++
Raw Normal View History

2022-10-09 16:39:46 +00:00
#include "TomlReader.h"
#include <filesystem>
2022-10-11 18:39:14 +00:00
#include <iostream>
2022-10-09 16:39:46 +00:00
int main()
{
2022-10-11 18:39:14 +00:00
const auto data_loc = std::filesystem::path(__FILE__) / "../../data";
2022-10-09 16:39:46 +00:00
const auto sample_toml_file = data_loc / "sample_toml.toml";
2022-10-10 07:57:32 +00:00
auto reader = TomlReader();
reader.read(sample_toml_file);
2022-10-09 16:39:46 +00:00
2022-10-11 18:39:14 +00:00
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;
}
2022-10-09 16:39:46 +00:00
return 0;
}