|
7 | 7 | Author : Kike Pérez |
8 | 8 | Version : 1.0 |
9 | 9 | Created : 18/10/2019 |
10 | | - Modified : 30/08/2021 |
| 10 | + Modified : 15/12/2021 |
11 | 11 |
|
12 | 12 | This file is part of QuickLib: https://github.com/exilon/QuickLib |
13 | 13 |
|
@@ -234,14 +234,14 @@ TFileOptionsContainer = class(TOptionsContainer) |
234 | 234 | procedure CreateFileMonitor; |
235 | 235 | procedure FileModifiedNotify(MonitorNotify : TMonitorNotify); |
236 | 236 | procedure SetReloadIfFileChanged(const Value: Boolean); |
237 | | - function GetFileSectionNames(out oSections: TArray<string>): Boolean; |
238 | 237 | public |
239 | 238 | constructor Create(aOptionsSerializer : IFileOptionsSerializer; aReloadIfFileChanged : Boolean = False); |
240 | 239 | destructor Destroy; override; |
241 | 240 | property FileName : string read fFilename; |
242 | 241 | property ReloadIfFileChanged : Boolean read fReloadIfFileChanged write SetReloadIfFileChanged; |
243 | 242 | property OnFileModified : TFileModifiedEvent read fOnFileModified write fOnFileModified; |
244 | 243 | procedure Save; override; |
| 244 | + function GetFileSectionNames(out oSections: TArray<string>): Boolean; |
245 | 245 | end; |
246 | 246 |
|
247 | 247 | IOptionsBuilder<T : TOptions> = interface |
@@ -347,7 +347,7 @@ destructor TOptionsContainer.Destroy; |
347 | 347 |
|
348 | 348 | function TOptionsContainer.GetFileSectionNames(out oSections: TArray<string>): Boolean; |
349 | 349 | begin |
350 | | - |
| 350 | + Result := fSerializer.GetFileSectionNames(oSections); |
351 | 351 | end; |
352 | 352 |
|
353 | 353 | function TOptionsContainer.GetOptions(aIndex: Integer): TOptions; |
@@ -420,9 +420,9 @@ procedure TOptionsContainer.Load(aFailOnSectionNotExists : Boolean = False); |
420 | 420 | end |
421 | 421 | else |
422 | 422 | begin |
423 | | - //if not exists file get default values |
| 423 | + //if config not exists get default values |
424 | 424 | for option in fSections do option.DefaultValues; |
425 | | - //creates default file |
| 425 | + //saves default |
426 | 426 | Save; |
427 | 427 | end; |
428 | 428 | end; |
|
0 commit comments