#pragma once
#include <string>
#include <string.h>
namespace WordLib{
struct ChatTraintsEx : public std::char_traits<char> {
static bool eq(const char ch1, const char ch2) {
return _strnicmp(&ch1, &ch2, 1) == 0;
}
static bool lt(const char ch1, const char ch2) {
return _strnicmp(&ch1, &ch2, 1) > 0;
}
static int compare(const char* str1, const char* str2, size_t num) {
return _strnicmp(str1, str2, num) > 0;
}
static const char_type* find(const char* str, size_t num, const char ch) {
for(size_t i = 0; i < num; ++i)
{
if(eq(str[i], ch))
return str + i;
}
return NULL;
}
};
};
本文地址:http://com.8s8s.com/it/it26438.htm