Mercurial > minori
annotate include/core/ini.h @ 286:53e3c015a973
anime: initial cross-service support
currently the Kitsu and MAL services don't work when chosen in the
GUI. This is because they haven't been implemented yet :)
author | Paper <paper@paper.us.eu.org> |
---|---|
date | Wed, 08 May 2024 16:44:27 -0400 |
parents | ec0a2b5493f8 |
children | b1f625b0227c |
rev | line source |
---|---|
261
3ec7804abf17
include: make header guards more sane
Paper <paper@paper.us.eu.org>
parents:
258
diff
changeset
|
1 #ifndef MINORI_CORE_INI_H_ |
3ec7804abf17
include: make header guards more sane
Paper <paper@paper.us.eu.org>
parents:
258
diff
changeset
|
2 #define MINORI_CORE_INI_H_ |
102 | 3 |
4 #define MINI_CASE_SENSITIVE | |
120 | 5 #include "core/strings.h" |
258 | 6 #include "mini/ini.h" |
7 #include <string> | |
102 | 8 |
116
254b1d2b7096
settings: add torrents page, make rss feed configurable
Paper <mrpapersonic@gmail.com>
parents:
102
diff
changeset
|
9 namespace INI { |
254b1d2b7096
settings: add torrents page, make rss feed configurable
Paper <mrpapersonic@gmail.com>
parents:
102
diff
changeset
|
10 |
276
ec0a2b5493f8
ini: simplify INI code, use templates less
Paper <paper@paper.us.eu.org>
parents:
261
diff
changeset
|
11 std::string GetIniString(const mINI::INIStructure& ini, const std::string& section, const std::string& key, const std::string& def); |
ec0a2b5493f8
ini: simplify INI code, use templates less
Paper <paper@paper.us.eu.org>
parents:
261
diff
changeset
|
12 bool GetIniBool(const mINI::INIStructure& ini, const std::string& section, const std::string& key, bool def); |
120 | 13 |
14 template<typename T> | |
276
ec0a2b5493f8
ini: simplify INI code, use templates less
Paper <paper@paper.us.eu.org>
parents:
261
diff
changeset
|
15 T GetIniInteger(const mINI::INIStructure& ini, const std::string& section, const std::string& key, T def) { |
ec0a2b5493f8
ini: simplify INI code, use templates less
Paper <paper@paper.us.eu.org>
parents:
261
diff
changeset
|
16 return Strings::ToInt<T>(GetIniString(ini, section, key, ""), def); |
120 | 17 } |
116
254b1d2b7096
settings: add torrents page, make rss feed configurable
Paper <mrpapersonic@gmail.com>
parents:
102
diff
changeset
|
18 |
258 | 19 } // namespace INI |
116
254b1d2b7096
settings: add torrents page, make rss feed configurable
Paper <mrpapersonic@gmail.com>
parents:
102
diff
changeset
|
20 |
120 | 21 #endif |