From ab4c9cca9429968806d0f356c073b9d7fd34189b Mon Sep 17 00:00:00 2001 From: zilmar Date: Wed, 24 Apr 2013 17:08:35 +1000 Subject: [PATCH] Common: Make ini file case insensitive --- Source/Common/Ini File Class.cpp | 1 - Source/Common/Ini File Class.h | 13 +++++++++---- 2 files changed, 9 insertions(+), 5 deletions(-) diff --git a/Source/Common/Ini File Class.cpp b/Source/Common/Ini File Class.cpp index eabceb61a..b1cda338a 100644 --- a/Source/Common/Ini File Class.cpp +++ b/Source/Common/Ini File Class.cpp @@ -133,7 +133,6 @@ int CIniFileBase::GetStringFromFile ( char * & String, char * &Data, int & MaxDa } DataSize += dwRead; } - return 0; } void CIniFileBase::SaveCurrentSection ( void ) diff --git a/Source/Common/Ini File Class.h b/Source/Common/Ini File Class.h index eb716e750..1343d6250 100644 --- a/Source/Common/Ini File Class.h +++ b/Source/Common/Ini File Class.h @@ -7,10 +7,15 @@ class CIniFileBase { - typedef std::string ansi_string; - typedef std::map FILELOC; - typedef FILELOC::iterator FILELOC_ITR; - typedef std::map KeyValueList; + struct insensitive_compare + { + bool operator() (const std::string & a, const std::string & b) const { return _stricmp(a.c_str(),b.c_str()) < 0; } + }; + + typedef std::string ansi_string; + typedef std::map FILELOC; + typedef FILELOC::iterator FILELOC_ITR; + typedef std::map KeyValueList; public: typedef std::map KeyValueData;