172 const TString Key, TString Value) {
173 bool result = false;
174 IniSectionData* section;
175
176 if (FMap.GetValue(SectionName, section) && section != NULL) {
177 result = section->SetValue(Key, Value);
178 }
179 else {
180 Append(SectionName, Key, Value);
181 }
182
183
184 return result;
185 }
186
187 bool IniFile::GetSection(const TString SectionName,
188 OrderedMap<TString, TString> &Data) {
189 bool result = false;
190
191 if (FMap.ContainsKey(SectionName) == true) {
192 IniSectionData* section;
193
194 if (FMap.GetValue(SectionName, section) == true && section != NULL) {
195 OrderedMap<TString, TString> data = section->GetData();
196 Data.Append(data);
197 result = true;
198 }
199 }
200
201 return result;
202 }
203
204 bool IniFile::ContainsSection(const TString SectionName) {
205 return FMap.ContainsKey(SectionName);
206 }
207
208 //----------------------------------------------------------------------------
209
210 IniSectionData::IniSectionData() {
211 FMap.SetAllowDuplicates(true);
212 }
|
172 const TString Key, TString Value) {
173 bool result = false;
174 IniSectionData* section;
175
176 if (FMap.GetValue(SectionName, section) && section != NULL) {
177 result = section->SetValue(Key, Value);
178 }
179 else {
180 Append(SectionName, Key, Value);
181 }
182
183
184 return result;
185 }
186
187 bool IniFile::GetSection(const TString SectionName,
188 OrderedMap<TString, TString> &Data) {
189 bool result = false;
190
191 if (FMap.ContainsKey(SectionName) == true) {
192 IniSectionData* section = NULL;
193
194 if (FMap.GetValue(SectionName, section) == true && section != NULL) {
195 OrderedMap<TString, TString> data = section->GetData();
196 Data.Append(data);
197 result = true;
198 }
199 }
200
201 return result;
202 }
203
204 bool IniFile::ContainsSection(const TString SectionName) {
205 return FMap.ContainsKey(SectionName);
206 }
207
208 //----------------------------------------------------------------------------
209
210 IniSectionData::IniSectionData() {
211 FMap.SetAllowDuplicates(true);
212 }
|