metaforce/Runtime/CStringExtras.hpp

30 lines
529 B
C++
Raw Normal View History

2016-02-13 09:02:47 +00:00
#ifndef __PSHAG_CSTRINGEXTRAS_HPP__
#define __PSHAG_CSTRINGEXTRAS_HPP__
2015-08-23 06:42:29 +00:00
#include <string>
#include <string.h>
2016-02-13 09:02:47 +00:00
namespace pshag
2015-08-23 06:42:29 +00:00
{
class CStringExtras
{
public:
static int CompareCaseInsensitive(const char* a, const char* b)
{
#if _WIN32
return _stricmp(a, b);
#else
return strcasecmp(a, b);
#endif
}
static int CompareCaseInsensitive(const std::string& a, const std::string& b)
{
return CompareCaseInsensitive(a.c_str(), b.c_str());
}
};
}
2016-02-13 09:02:47 +00:00
#endif // __PSHAG_CSTRINGEXTRAS_HPP__