29 #ifndef AGS_SHARED_UTIL_INI_UTIL_H 30 #define AGS_SHARED_UTIL_INI_UTIL_H 32 #include "common/std/map.h" 33 #include "ags/shared/util/string.h" 44 bool CfgReadItem(
const ConfigTree &cfg,
const String §n,
const String &item, String &value);
45 int CfgReadInt(
const ConfigTree &cfg,
const String §n,
const String &item,
int def = 0);
46 int CfgReadInt(
const ConfigTree &cfg,
const String §n,
const String &item,
int min,
int max,
int def = 0);
47 inline bool CfgReadBoolInt(
const ConfigTree &cfg,
const String §n,
const String &item,
bool def =
false) {
48 return CfgReadInt(cfg, sectn, item, 0, 1, def) != 0;
50 float CfgReadFloat(
const ConfigTree &cfg,
const String §n,
const String &item,
float def = 0.f);
51 float CfgReadFloat(
const ConfigTree &cfg,
const String §n,
const String &item,
float min,
float max,
float def = 0.f);
52 String CfgReadString(
const ConfigTree &cfg,
const String §n,
const String &item,
const String &def =
"");
56 String CfgFindKey(
const ConfigTree &cfg,
const String §n,
const String &item,
bool nocase =
false);
60 void CfgWriteInt(ConfigTree &cfg,
const String §n,
const String &item,
int value);
61 inline void CfgWriteBoolInt(ConfigTree &cfg,
const String §n,
const String &item,
bool value) {
62 CfgWriteInt(cfg, sectn, item, static_cast<int>(value));
64 void CfgWriteFloat(ConfigTree &cfg,
const String §n,
const String &item,
float value);
65 void CfgWriteFloat(ConfigTree &cfg,
const String §n,
const String &item,
float value,
unsigned precision);
66 void CfgWriteString(ConfigTree &cfg,
const String §n,
const String &item,
const String &value);
77 bool Read(
const String &file, ConfigTree &tree);
82 void Write(
const String &file,
const ConfigTree &tree);
86 void WriteToString(String &s,
const ConfigTree &tree);
96 bool Merge(
const String &file,
const ConfigTree &tree);
Definition: achievements_tables.h:27