annotate include/core/ini.h @ 304:2115488eb302

*: add very early season searcher
author Paper <paper@paper.us.eu.org>
date Mon, 13 May 2024 17:02:35 -0400
parents b1f625b0227c
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
301
b1f625b0227c *: convert all files CRLF -> LF
Paper <paper@paper.us.eu.org>
parents: 276
diff changeset
1 #ifndef MINORI_CORE_INI_H_
b1f625b0227c *: convert all files CRLF -> LF
Paper <paper@paper.us.eu.org>
parents: 276
diff changeset
2 #define MINORI_CORE_INI_H_
b1f625b0227c *: convert all files CRLF -> LF
Paper <paper@paper.us.eu.org>
parents: 276
diff changeset
3
b1f625b0227c *: convert all files CRLF -> LF
Paper <paper@paper.us.eu.org>
parents: 276
diff changeset
4 #define MINI_CASE_SENSITIVE
b1f625b0227c *: convert all files CRLF -> LF
Paper <paper@paper.us.eu.org>
parents: 276
diff changeset
5 #include "core/strings.h"
b1f625b0227c *: convert all files CRLF -> LF
Paper <paper@paper.us.eu.org>
parents: 276
diff changeset
6 #include "mini/ini.h"
b1f625b0227c *: convert all files CRLF -> LF
Paper <paper@paper.us.eu.org>
parents: 276
diff changeset
7 #include <string>
b1f625b0227c *: convert all files CRLF -> LF
Paper <paper@paper.us.eu.org>
parents: 276
diff changeset
8
b1f625b0227c *: convert all files CRLF -> LF
Paper <paper@paper.us.eu.org>
parents: 276
diff changeset
9 namespace INI {
b1f625b0227c *: convert all files CRLF -> LF
Paper <paper@paper.us.eu.org>
parents: 276
diff changeset
10
b1f625b0227c *: convert all files CRLF -> LF
Paper <paper@paper.us.eu.org>
parents: 276
diff changeset
11 std::string GetIniString(const mINI::INIStructure& ini, const std::string& section, const std::string& key, const std::string& def);
b1f625b0227c *: convert all files CRLF -> LF
Paper <paper@paper.us.eu.org>
parents: 276
diff changeset
12 bool GetIniBool(const mINI::INIStructure& ini, const std::string& section, const std::string& key, bool def);
b1f625b0227c *: convert all files CRLF -> LF
Paper <paper@paper.us.eu.org>
parents: 276
diff changeset
13
b1f625b0227c *: convert all files CRLF -> LF
Paper <paper@paper.us.eu.org>
parents: 276
diff changeset
14 template<typename T>
b1f625b0227c *: convert all files CRLF -> LF
Paper <paper@paper.us.eu.org>
parents: 276
diff changeset
15 T GetIniInteger(const mINI::INIStructure& ini, const std::string& section, const std::string& key, T def) {
b1f625b0227c *: convert all files CRLF -> LF
Paper <paper@paper.us.eu.org>
parents: 276
diff changeset
16 return Strings::ToInt<T>(GetIniString(ini, section, key, ""), def);
b1f625b0227c *: convert all files CRLF -> LF
Paper <paper@paper.us.eu.org>
parents: 276
diff changeset
17 }
b1f625b0227c *: convert all files CRLF -> LF
Paper <paper@paper.us.eu.org>
parents: 276
diff changeset
18
b1f625b0227c *: convert all files CRLF -> LF
Paper <paper@paper.us.eu.org>
parents: 276
diff changeset
19 } // namespace INI
b1f625b0227c *: convert all files CRLF -> LF
Paper <paper@paper.us.eu.org>
parents: 276
diff changeset
20
b1f625b0227c *: convert all files CRLF -> LF
Paper <paper@paper.us.eu.org>
parents: 276
diff changeset
21 #endif