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

24 lines
426 B
C
Raw Normal View History

2007-09-07 23:17:30 +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);
}
};