#include <vector>
#include <iostream>

#include <configfile.hpp>
#include <paths.hpp>
#include <error.hpp>
#include <tomlcpp.hpp>

bool configFileOpen(struct optData* data) {
	auto configFile = toml::parseFile(prefixConfig + "config.toml");
	if (!configFile.table) {
		return false;
	}

	auto useHaarResult = configFile.table->getBool("use_haar");
	if (useHaarResult.first) {
		data->useHaar = useHaarResult.second;
	}
	auto modelNameResult = configFile.table->getString("model");
	if (modelNameResult.first) {
		data->model = modelNameResult.second;
	}

	return true;
}
