From c3fafdca999f15fd5c33cc32bb61cb39ce57d430 Mon Sep 17 00:00:00 2001 From: Ykkrosh Date: Thu, 9 Dec 2004 16:54:02 +0000 Subject: [PATCH] Added CStr::FindInsensitive This was SVN commit r1479. --- source/ps/CStr.cpp | 5 +++++ source/ps/CStr.h | 5 +++++ 2 files changed, 10 insertions(+) diff --git a/source/ps/CStr.cpp b/source/ps/CStr.cpp index bdcee064f6..a7ab58d707 100755 --- a/source/ps/CStr.cpp +++ b/source/ps/CStr.cpp @@ -119,6 +119,11 @@ long CStr::Find(const int &start, const TCHAR &tchar) const return -1; } +long CStr::FindInsensitive(const int &start, const TCHAR &tchar) const { return LCase().Find(start, _totlower(tchar)); } +long CStr::FindInsensitive(const TCHAR &tchar) const { return LCase().Find(_totlower(tchar)); } +long CStr::FindInsensitive(const CStr& Str) const { return LCase().Find(Str.LCase()); } + + long CStr::ReverseFind(const CStr& Str) const { size_t Pos = rfind(Str, length() ); diff --git a/source/ps/CStr.h b/source/ps/CStr.h index 13b1fb74e8..b5979d3cad 100755 --- a/source/ps/CStr.h +++ b/source/ps/CStr.h @@ -155,6 +155,11 @@ public: long Find(const TCHAR &tchar) const; long Find(const int &start, const TCHAR &tchar) const; + // Case-insensitive versions of Find + long FindInsensitive(const CStr& Str) const; + long FindInsensitive(const TCHAR &tchar) const; + long FindInsensitive(const int &start, const TCHAR &tchar) const; + // You can also do a "ReverseFind" - i.e. search starting from the end long ReverseFind(const CStr& Str) const;