view include/core/ini.h @ 317:b1f4d1867ab1

services: VERY initial Kitsu support it only supports user authentication for now, but it's definitely a start.
author Paper <paper@paper.us.eu.org>
date Wed, 12 Jun 2024 04:07:10 -0400
parents b1f625b0227c
children
line wrap: on
line source

#ifndef MINORI_CORE_INI_H_
#define MINORI_CORE_INI_H_

#define MINI_CASE_SENSITIVE
#include "core/strings.h"
#include "mini/ini.h"
#include <string>

namespace INI {

std::string GetIniString(const mINI::INIStructure& ini, const std::string& section, const std::string& key, const std::string& def);
bool GetIniBool(const mINI::INIStructure& ini, const std::string& section, const std::string& key, bool def);

template<typename T>
T GetIniInteger(const mINI::INIStructure& ini, const std::string& section, const std::string& key, T def) {
	return Strings::ToInt<T>(GetIniString(ini, section, key, ""), def);
}

} // namespace INI

#endif