uLib
User mode C/C++ extended API library for Win32 programmers.
|
Additional string functions and classes.
#include <uLib/StrFunc.h>
Groups | |
String Allocation and Duplication | |
MultiByte Translations | |
Resource Strings | |
Multi-Strings | |
Special String Functions | |
GUID Strings | |
UNICODE_STRING Support | |
Classes | |
struct | StringEntry |
class | StringCache |
class | WordList |
Macros | |
#define | BEGIN_STRSAFE_OVERRIDE __pragma( warning( disable:4996 )) |
#define | END_STRSAFE_OVERRIDE __pragma( warning( default:4996 )) |
#define | _tcsecpy strecpy |
#define | _tcsnecpy strnecpy |
#define | _tcsistr stristr |
#define | _tcsncpyz strncpyz |
#define | _tcsnchr (CSTR)memchr |
Typedefs | |
typedef class StringCache * | PStringCache |
typedef class WordList * | PWordList |
Functions | |
char *__fastcall | strecpy (register char *Dst, register const char *Src) |
wchar_t *__fastcall | wcsecpy (register wchar_t *Dst, register const wchar_t *Src) |
char *__fastcall | strnecpy (register char *Dst, register const char *Src, size_t N) |
wchar_t *__fastcall | wcsnecpy (register wchar_t *Dst, register const wchar_t *Src, size_t N) |
char * | stristr (const char *str, const char *pattern) |
wchar_t * | wcsistr (const wchar_t *str, const wchar_t *pattern) |
char *__fastcall | strncpyz (register char *Dst, register const char *Src, size_t Count) |
wchar_t *__fastcall | wcsncpyz (register wchar_t *Dst, register const wchar_t *Src, size_t Count) |
size_t | wcsbytes (const wchar_t *Src) |
bool __forceinline | IsString (CSTR Str) |
template<typename chrType > | |
INT_PTR | CharIndex (const chrType *Buffer, const chrType *Inside) |
INT_PTR | CharIndexA (const CHAR *Buffer, const CHAR *Inside) |
INT_PTR | CharIndexW (const WCHAR *Buffer, const WCHAR *Inside) |
#define BEGIN_STRSAFE_OVERRIDE __pragma( warning( disable:4996 )) |
#define END_STRSAFE_OVERRIDE __pragma( warning( default:4996 )) |
typedef class StringCache* PStringCache |
char* __fastcall strecpy | ( | register char * | Dst, |
register const char * | Src | ||
) |
strecpy() copies a string and returns a pointer to the ending NUL char in Dst.
For concatenation, strecpy() beats strcat() by a mile and a half !!
(PS. In Borland's CRTL this is (was?) called stpcpy() for some reason.)
Definition at line 37 of file StrFunc.cpp.
wchar_t* __fastcall wcsecpy | ( | register wchar_t * | Dst, |
register const wchar_t * | Src | ||
) |
See strecpy()
Definition at line 68 of file StrFunc.cpp.
char* __fastcall strnecpy | ( | register char * | Dst, |
register const char * | Src, | ||
size_t | N | ||
) |
Run length limited versions of strecpy() / wcsecpy().
Definition at line 77 of file StrFunc.cpp.
wchar_t* __fastcall wcsnecpy | ( | register wchar_t * | Dst, |
register const wchar_t * | Src, | ||
size_t | N | ||
) |
See strnecpy()
Definition at line 84 of file StrFunc.cpp.
char* stristr | ( | const char * | str, |
const char * | pattern | ||
) |
stristr() is a fast case insensitive strstr().
It searches for pattern in the string str, and returns pointer to the found string, or NULL on failure.
Credits to Lefteris E for the neat algorithm !
Definition at line 96 of file StrFunc.cpp.
wchar_t* wcsistr | ( | const wchar_t * | str, |
const wchar_t * | pattern | ||
) |
See stristr()
Definition at line 113 of file StrFunc.cpp.
char* __fastcall strncpyz | ( | register char * | Dst, |
register const char * | Src, | ||
size_t | Count | ||
) |
strncpyz() is a strncpy() with guaranteed NUL termination.
Count is the buffer length, including the NUL terminator.
Definition at line 134 of file StrFunc.cpp.
wchar_t* __fastcall wcsncpyz | ( | register wchar_t * | Dst, |
register const wchar_t * | Src, | ||
size_t | Count | ||
) |
See strncpyz()
Definition at line 142 of file StrFunc.cpp.
size_t wcsbytes | ( | const wchar_t * | Src | ) |
Return nr of bytes (including NUL) in a wide-string.
Definition at line 154 of file StrFunc.cpp.
bool __forceinline IsString | ( | CSTR | Str | ) |
IsString() checks that Str is not NULL and not blank.
INT_PTR CharIndex | ( | const chrType * | Buffer, |
const chrType * | Inside | ||
) |
CharIndex() returns the index into Buffer, of the Inside pointer, in TCHARs.
INT_PTR CharIndexA | ( | const CHAR * | Buffer, |
const CHAR * | Inside | ||
) |
INT_PTR CharIndexW | ( | const WCHAR * | Buffer, |
const WCHAR * | Inside | ||
) |