示例#1
0
int NumStrCmpI(const wchar_t *s1, const wchar_t *s2) { return NumStrCmp(s1, -1, s2, -1, true); }
示例#2
0
int NumStrCmp(const wchar_t *s1, const wchar_t *s2) { return NumStrCmp(s1, -1, s2, -1, false); }
示例#3
0
int NumStrCmpNI(const wchar_t *s1, size_t n1, const wchar_t *s2, size_t n2) { return NumStrCmp(s1, n1, s2, n2, true); }
示例#4
0
int NumStrCmpN(const wchar_t *s1, size_t n1, const wchar_t *s2, size_t n2) { return NumStrCmp(s1, n1, s2, n2, false); }
示例#5
0
}

static inline int NumStrCmp(const wchar_t *s1, size_t n1, const wchar_t *s2, size_t n2, bool IgnoreCase)
{
	return NumStrCmp_base(s1, n1, s2, n2, IgnoreCase? StrCmpNI : StrCmpN);
}

int NumStrCmpN(const wchar_t *s1, size_t n1, const wchar_t *s2, size_t n2) { return NumStrCmp(s1, n1, s2, n2, false); }
int NumStrCmpNI(const wchar_t *s1, size_t n1, const wchar_t *s2, size_t n2) { return NumStrCmp(s1, n1, s2, n2, true); }
int NumStrCmpNC(const wchar_t *s1, size_t n1, const wchar_t *s2, size_t n2) { return NumStrCmpC(s1, n1, s2, n2); }
int NumStrCmp(const wchar_t *s1, const wchar_t *s2) { return NumStrCmp(s1, -1, s2, -1, false); }
int NumStrCmpI(const wchar_t *s1, const wchar_t *s2) { return NumStrCmp(s1, -1, s2, -1, true); }
int NumStrCmpC(const wchar_t *s1, const wchar_t *s2) { return NumStrCmpC(s1, -1, s2, -1); }

SELF_TEST(
	assert(!NumStrCmp(L"", -1, L"", -1, false));
	assert(NumStrCmp(L"", -1, L"a", -1, false) < 0);
	assert(!NumStrCmp(L"a", -1, L"a", -1, false));

	assert(NumStrCmp(L"0", -1, L"1", -1, false) < 0);
	assert(NumStrCmp(L"0", -1, L"00", -1, false) < 0);
	assert(NumStrCmp(L"1", -1, L"00", -1, false) > 0);
	assert(NumStrCmp(L"10", -1, L"1", -1, false) > 0);
	assert(NumStrCmp(L"10", -1, L"2", -1, false) > 0);
	assert(NumStrCmp(L"10", -1, L"0100", -1, false) < 0);
	assert(NumStrCmp(L"1", -1, L"001", -1, false) < 0);

	assert(NumStrCmp(L"10a", -1, L"2b", -1, false) > 0);
	assert(NumStrCmp(L"10a", -1, L"0100b", -1, false) < 0);
	assert(NumStrCmp(L"a1a", -1, L"a001a", -1, false) < 0);
	assert(!NumStrCmp(L"a1b2c", -1, L"a1b2c", -1, false));
示例#6
0
inline int NumStrCmpN(const wchar_t *s1, int n1, const wchar_t *s2, int n2) { return NumStrCmp(s1, n1, s2, n2, false); }