changes...

This commit is contained in:
3lswear
2022-01-04 18:31:10 +03:00
parent 4cc8dfeace
commit 4aec6d4657
6 changed files with 248 additions and 45 deletions

View File

@@ -6,8 +6,9 @@
#include <iostream>
#include <exception>
#include "TOMLNode.cpp"
#include "TOMLParser.cpp"
#include "TOMLNode.hpp"
#include "TOMLParser.hpp"
#include "Tokenizer.hpp"
/* struct location */
/* { */
@@ -20,9 +21,20 @@
/* { */
/* std::string name; */
/* } */
namespace config
{
void display(TOMLMap *config)
{
std::cout << "printing config:" << std::endl;
std::cout << (*config)["name"] << std::endl;
std::cout << (*config)["port"] << std::endl;
}
}
void parse(void)
{
std::string filename = "config/simple.toml";
config::TOMLParser parser(filename);
toml_node *root = parser.parse();
config::display(root->getMap());
}