From 69ca3d65b82ab041e8df85ca3f4e63e669557607 Mon Sep 17 00:00:00 2001 From: lloyd Date: Mon, 19 Jun 2006 09:20:23 +0000 Subject: Remove the to_lower function; turns out that both uses of it within the library were to perform case-insensitive matching, so simply implement that instead. Place all of the character set handling functions into a Charset namespace (and update all callers). Remove the iso2local/local2iso/iso2utf/utf2iso functions, replaced by the new charset transcoder stuff. Initialize the transcoder stored in the global library state upon initialization. --- src/x509find.cpp | 12 ++---------- 1 file changed, 2 insertions(+), 10 deletions(-) (limited to 'src/x509find.cpp') diff --git a/src/x509find.cpp b/src/x509find.cpp index 2ba430caf..f78c037b5 100644 --- a/src/x509find.cpp +++ b/src/x509find.cpp @@ -19,14 +19,6 @@ namespace { *************************************************/ typedef bool (*compare_fn)(const std::string&, const std::string&); -/************************************************* -* Predicate for caseless searching * -*************************************************/ -bool caseless_cmp(char a, char b) - { - return (to_lower(a) == to_lower(b)); - } - /************************************************* * Compare based on case-insensive substrings * *************************************************/ @@ -34,7 +26,7 @@ bool substring_match(const std::string& searching_for, const std::string& found) { if(std::search(found.begin(), found.end(), searching_for.begin(), - searching_for.end(), caseless_cmp) != found.end()) + searching_for.end(), Charset::caseless_cmp) != found.end()) return true; return false; } @@ -48,7 +40,7 @@ bool ignore_case(const std::string& searching_for, const std::string& found) return false; return std::equal(found.begin(), found.end(), - searching_for.begin(), caseless_cmp); + searching_for.begin(), Charset::caseless_cmp); } /************************************************* -- cgit v1.2.3