xml-copy-editor-code/src/nocasecompare.h

24 lines
426 B
C
Raw Normal View History

2007-08-30 01:12:56 +02:00
#include <string>
using namespace std;
class NoCaseCompare
{
public:
NoCaseCompare();
~NoCaseCompare();
bool operator() (const string& s, const string& t) const
{
return lexicographical_compare(
s.begin(), s.end(),
t.begin(), t.end(),
noCaseCompare);
}
private:
static bool noCaseCompare(char c1, char c2)
{
return toupper(c1) < toupper(c2);
}
};