added qse_mbsxistype(0 and qse_wcsxistype()
This commit is contained in:
		| @ -3009,15 +3009,29 @@ QSE_EXPORT int qse_mbsistype ( | |||||||
| 	qse_mctype_t       type | 	qse_mctype_t       type | ||||||
| ); | ); | ||||||
|  |  | ||||||
|  | QSE_EXPORT int qse_mbsxistype ( | ||||||
|  | 	const qse_mchar_t* str, | ||||||
|  | 	qse_size_t         len, | ||||||
|  | 	qse_mctype_t       type | ||||||
|  | ); | ||||||
|  |  | ||||||
| QSE_EXPORT int qse_wcsistype ( | QSE_EXPORT int qse_wcsistype ( | ||||||
| 	const qse_wchar_t* str,  | 	const qse_wchar_t* str,  | ||||||
| 	qse_wctype_t       type | 	qse_wctype_t       type | ||||||
| ); | ); | ||||||
|  |  | ||||||
|  | QSE_EXPORT int qse_wcsxistype ( | ||||||
|  | 	const qse_wchar_t* str, | ||||||
|  | 	qse_size_t         len, | ||||||
|  | 	qse_wctype_t       type | ||||||
|  | ); | ||||||
|  |  | ||||||
| #if defined(QSE_CHAR_IS_MCHAR) | #if defined(QSE_CHAR_IS_MCHAR) | ||||||
| #	define qse_stristype(str,type) qse_mbsistype(str,type) | #	define qse_stristype(str,type) qse_mbsistype(str,type) | ||||||
|  | #	define qse_strxistype(str,len,type) qse_mbsxistype(str,len,type) | ||||||
| #else | #else | ||||||
| #	define qse_stristype(str,type) qse_wcsistype(str,type) | #	define qse_stristype(str,type) qse_wcsistype(str,type) | ||||||
|  | #	define qse_strxistype(str,len,type) qse_wcsxistype(str,len,type) | ||||||
| #endif | #endif | ||||||
| /* ------------------------------------------------------------------------- */ | /* ------------------------------------------------------------------------- */ | ||||||
|  |  | ||||||
|  | |||||||
| @ -38,6 +38,19 @@ int qse_mbsistype (const qse_mchar_t* str, qse_mctype_t type) | |||||||
| 	return 1; | 	return 1; | ||||||
| } | } | ||||||
|  |  | ||||||
|  | int qse_mbsxistype (const qse_mchar_t* str, qse_size_t len, qse_mctype_t type) | ||||||
|  | { | ||||||
|  | 	const qse_mchar_t* end = str + len; | ||||||
|  | 	while (str < end) | ||||||
|  | 	{ | ||||||
|  | 		if (!qse_ismctype(*str, type)) return 0; | ||||||
|  | 		str++; | ||||||
|  | 	} | ||||||
|  | 	return 1; | ||||||
|  | } | ||||||
|  |  | ||||||
|  | /* -------------------------------------------------------------------------- */ | ||||||
|  |  | ||||||
| int qse_wcsistype (const qse_wchar_t* str, qse_wctype_t type) | int qse_wcsistype (const qse_wchar_t* str, qse_wctype_t type) | ||||||
| { | { | ||||||
| 	while (*str) | 	while (*str) | ||||||
| @ -47,3 +60,14 @@ int qse_wcsistype (const qse_wchar_t* str, qse_wctype_t type) | |||||||
| 	} | 	} | ||||||
| 	return 1; | 	return 1; | ||||||
| } | } | ||||||
|  |  | ||||||
|  | int qse_wcsxistype (const qse_wchar_t* str, qse_size_t len, qse_wctype_t type) | ||||||
|  | { | ||||||
|  | 	const qse_wchar_t* end = str + len; | ||||||
|  | 	while (str < end) | ||||||
|  | 	{ | ||||||
|  | 		if (!qse_iswctype(*str, type)) return 0; | ||||||
|  | 		str++; | ||||||
|  | 	} | ||||||
|  | 	return 1; | ||||||
|  | } | ||||||
|  | |||||||
		Reference in New Issue
	
	Block a user