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

22 lines
550 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()
{
const auto data_loc = std::filesystem::path(__FILE__) / "../../data";
const auto sample_toml_file = data_loc / "sample_toml.toml";
2022-10-09 16:39:46 +00:00
auto reader = TomlReader();
reader.read(sample_toml_file);
2022-10-09 16:39:46 +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-11 18:39:14 +00:00
return 0;
}