mirror of
https://github.com/AxioDL/metaforce.git
synced 2025-12-09 01:07:43 +00:00
various implementation
This commit is contained in:
29
Runtime/CStringExtras.hpp
Normal file
29
Runtime/CStringExtras.hpp
Normal file
@@ -0,0 +1,29 @@
|
||||
#ifndef __RETRO_CSTRINGEXTRAS_HPP__
|
||||
#define __RETRO_CSTRINGEXTRAS_HPP__
|
||||
|
||||
#include <string>
|
||||
#include <string.h>
|
||||
|
||||
namespace Retro
|
||||
{
|
||||
|
||||
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());
|
||||
}
|
||||
};
|
||||
|
||||
}
|
||||
|
||||
#endif // __RETRO_CSTRINGEXTRAS_HPP__
|
||||
Reference in New Issue
Block a user