/
githubmirror
/
inih
Обзор
Документация
Войти
/
githubmirror
/
inih
Код
Запросы
0
Пакеты
0
Релизы
0
Аналитика
Безопасность
r42
examples/INIReaderExample.cpp
21 строка
696 B
Justin White
Move INIReaderTest.cpp to examples/ for consistency (#54)
15 сен 2016, 20:23
15 сен 2016, 20:23
60b5ad3
Код
Авторство
О чём код?
// Example that shows simple usage of the INIReader class #include <iostream> #include "../cpp/INIReader.h" int main() { INIReader reader("../examples/test.ini"); if (reader.ParseError() < 0) { std::cout << "Can't load 'test.ini'\n"; return 1; } std::cout << "Config loaded from 'test.ini': version=" << reader.GetInteger("protocol", "version", -1) << ", name=" << reader.Get("user", "name", "UNKNOWN") << ", email=" << reader.Get("user", "email", "UNKNOWN") << ", pi=" << reader.GetReal("user", "pi", -1) << ", active=" << reader.GetBoolean("user", "active", true) << "\n"; return 0; }