Moved compareIgnoringCase to util.cpp
parent
b99d3f44e9
commit
e128071949
|
@ -8,6 +8,7 @@
|
||||||
// of the License, or (at your option) any later version.
|
// of the License, or (at your option) any later version.
|
||||||
|
|
||||||
#include <cctype>
|
#include <cctype>
|
||||||
|
#include "util.h"
|
||||||
#include "filetype.h"
|
#include "filetype.h"
|
||||||
|
|
||||||
using namespace std;
|
using namespace std;
|
||||||
|
@ -22,23 +23,6 @@ static const string CelestiaTextureExt(".ctx");
|
||||||
static const string CelestiaMeshExt(".cms");
|
static const string CelestiaMeshExt(".cms");
|
||||||
|
|
||||||
|
|
||||||
static int compareIgnoringCase(const string& s1, const string& s2)
|
|
||||||
{
|
|
||||||
string::const_iterator i1 = s1.begin();
|
|
||||||
string::const_iterator i2 = s2.begin();
|
|
||||||
|
|
||||||
while (i1 != s1.end() && i2 != s2.end())
|
|
||||||
{
|
|
||||||
if (toupper(*i1) != toupper(*i2))
|
|
||||||
return (toupper(*i1) < toupper(*i2)) ? -1 : 1;
|
|
||||||
++i1;
|
|
||||||
++i2;
|
|
||||||
}
|
|
||||||
|
|
||||||
return s2.size() - s1.size();
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
ContentType DetermineFileType(const string& filename)
|
ContentType DetermineFileType(const string& filename)
|
||||||
{
|
{
|
||||||
int extPos = filename.length() - 4;
|
int extPos = filename.length() - 4;
|
||||||
|
|
Loading…
Reference in New Issue