ReadBoolean

This commit is contained in:
mysticbbs 2012-09-26 16:48:39 -04:00
parent 6376151631
commit 3790e66463
1 changed files with 14 additions and 0 deletions

View File

@ -17,6 +17,7 @@ Type
Destructor Destroy; Override;
Function ReadString (Category, Value, DefValue: String) : String;
Function ReadInteger (Category, Value: String; DefValue: LongInt) : LongInt;
Function ReadBoolean (Category, Value: String; DefValue: Boolean) : Boolean;
End;
Implementation
@ -98,4 +99,17 @@ Begin
Result := strS2I(ReadString(Category, Value, strI2S(DefValue)));
End;
Function TIniReader.ReadBoolean (Category, Value: String; DefValue: Boolean) : Boolean;
Var
DefStr : String;
Begin
If DefValue Then
DefStr := 'TRUE'
Else
DefStr := 'FALSE';
Result := strUpper(ReadString(Category, Value, DefStr)) = 'TRUE';
End;
End.