From 3790e66463b0c7976c087d0b205f06142eeef79d Mon Sep 17 00:00:00 2001 From: mysticbbs Date: Wed, 26 Sep 2012 16:48:39 -0400 Subject: [PATCH] ReadBoolean --- mdl/m_inireader.pas | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/mdl/m_inireader.pas b/mdl/m_inireader.pas index 20ebeb9..bb58391 100644 --- a/mdl/m_inireader.pas +++ b/mdl/m_inireader.pas @@ -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.