32 #ifndef AGS_SHARED_UTIL_INIFILE_H 33 #define AGS_SHARED_UTIL_INIFILE_H 35 #include "common/std/list.h" 36 #include "common/std/utility.h" 37 #include "ags/shared/util/string.h" 52 inline static bool IsValidStrPos(
const StrPos &pos) {
53 return pos.first < pos.second;
62 ItemDef(
const String &line,
const StrPos &key,
const StrPos &value,
size_t sep_at);
67 return SubString(
Line, Key);
73 bool IsKeyValue()
const {
74 return IsValidStrPos(Key);
76 void SetKey(
const String &key);
77 void SetValue(
const String &value);
99 return SubString(Header, Name);
101 size_t GetItemCount()
const {
105 bool IsGlobal()
const {
106 return !IsValidStrPos(Name);
108 ItemIterator Begin() {
109 return Items.begin();
114 ConstItemIterator CBegin()
const {
115 return Items.begin();
117 ConstItemIterator CEnd()
const {
120 void SetName(
const String &sec_name);
122 ItemIterator InsertItem(ItemIterator item,
const ItemDef &itemdef);
123 void EraseItem(ItemIterator item);
137 inline static String SubString(
const String &line,
const StrPos &pos) {
138 return line.Mid(pos.first, pos.second - pos.first);
144 SectionIterator Begin() {
145 return _sections.begin();
147 SectionIterator End() {
148 return _sections.end();
150 ConstSectionIterator CBegin()
const {
151 return _sections.begin();
153 ConstSectionIterator CEnd()
const {
154 return _sections.end();
158 void Write(
Stream *out)
const;
161 size_t GetSectionCount()
const {
162 return _sections.size();
165 ItemIterator InsertItem(SectionIterator sec, ItemIterator item,
const String &key,
const String &value);
167 SectionIterator InsertSection(SectionIterator sec,
const String &name);
169 void RemoveItem(SectionIterator sec, ItemIterator item);
172 void RemoveSection(SectionIterator sec);
Definition: achievements_tables.h:27
Definition: geometry.h:114
Definition: ini_file.h:59
Definition: ini_file.h:43
Definition: list_intern.h:48
Definition: list_intern.h:51
Definition: ini_file.h:91