| 1 |
unit TestCastleConfig; |
| 2 |
|
| 3 |
interface |
| 4 |
|
| 5 |
uses CastleConfig; |
| 6 |
|
| 7 |
procedure TestCastleConfig1; |
| 8 |
|
| 9 |
implementation |
| 10 |
|
| 11 |
uses CastleLog; |
| 12 |
|
| 13 |
procedure TestCastleConfig1; |
| 14 |
begin |
| 15 |
WritelnLog('Load user config'); |
| 16 |
UserConfig.Load; |
| 17 |
|
| 18 |
WritelnLog('XML Dump: ' + UserConfig.Document.InternalDocument.XML.Text); |
| 19 |
|
| 20 |
WritelnLog('Add int0 with value 123'); |
| 21 |
UserConfig.SetInt64('int0', 123); |
| 22 |
WritelnLog('Add path1/int1 with value 123'); |
| 23 |
UserConfig.SetInt64('path1/int1', 123); |
| 24 |
WritelnLog('Add text with value text_value'); |
| 25 |
UserConfig.SetValue('text', 'text_value'); |
| 26 |
|
| 27 |
WritelnLog('XML Dump: ' + UserConfig.Document.InternalDocument.XML.Text); |
| 28 |
|
| 29 |
WritelnLog('Delete text'); |
| 30 |
UserConfig.DeleteValue('text'); |
| 31 |
|
| 32 |
WritelnLog('Delete path1/int1'); |
| 33 |
UserConfig.DeleteValue('path1/int1'); |
| 34 |
|
| 35 |
WritelnLog('XML Dump: ' + UserConfig.Document.InternalDocument.XML.Text); |
| 36 |
|
| 37 |
|
| 38 |
UserConfig.Save; |
| 39 |
|
| 40 |
end; |
| 41 |
|
| 42 |
end. |
| 43 |
|