//
// C++ Implementation: utils
//
// Description: 
//
//
// Author: Faubet Pierre <pierre.faubet@e.ujf-grenoble.fr>, (C) 2007
//
// Copyright: See COPYING file that comes with this distribution
//
//

#include "utils.h"

int cmp_nocase(const string& s, const string& s2)
{
	string::const_iterator p = s.begin();
	string::const_iterator p2 = s2.begin();

	while (p != s.end() && p2 != s2.end())
	{
		if (toupper(*p) != toupper(*p2)) return((toupper(*p)<toupper(*p2)) ? -1 : 1);
		++p;
		++p2;
	}
	return((s2.size()==s.size()) ? 0 : (s2.size()<s.size()) ? -1 : 1);
}
