Mercurial > minori
annotate include/core/ini.h @ 314:76d7315504c4
README: remove mention of nonexistant /docs directory
author | Paper <paper@paper.us.eu.org> |
---|---|
date | Tue, 11 Jun 2024 13:29:45 -0400 |
parents | b1f625b0227c |
children |
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 |