uLib  User mode C/C++ extended API library for Win32 programmers.
StrFunc.h File Reference
#include <uLib/MemFunc.h>
#include <String.h>
#include <Time.h>

Go to the source code of this file.

Classes

struct  RC_STRING
 
class  UString
 
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
 
#define mem_DupStr   mem_DupAStr
 
#define mem_AllocStr   mem_AllocAStr
 
#define EnumerateMultiSz   EnumerateMultiSzA
 
#define PFnEnumMultiString   PFnEnumMultiStringA
 
#define MultiSzLength   MultiSzLengthA
 
#define MultiSzCount   MultiSzCountA
 
#define HASH_STRING_ALGORITHM_DEFAULT   (0)
 
#define HASH_STRING_ALGORITHM_X65599   (1)
 
#define HASH_STRING_ALGORITHM_INVALID   (0xffffffff)
 
#define DEF_DATETIME_FMT   _T("%Y-%m-%d %H.%M.%S")
 
#define INIT_PACKED_UNICODE_STRING(pu, bufsize)
 

Typedefs

typedef bool(__stdcall * PFnEnumMultiStringA) (ASTR Str, PVOID Context)
 
typedef bool(__stdcall * PFnEnumMultiStringW) (WSTR Str, PVOID Context)
 
typedef class StringCachePStringCache
 
typedef class WordListPWordList
 

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)
 
CSTR newStr (CSTR Src)
 
TSTR newStrBuf (WORD nChar)
 
CSTR deleteStr (CSTR Dup)
 
WCSTR newWStr (WCSTR Src)
 
WCSTR deleteWStr (WCSTR Dup)
 
ASTR mem_DupAStr (ACSTR Src)
 
WSTR mem_DupWStr (WCSTR Src)
 
ASTR mem_AllocAStr (WORD nChar)
 
WSTR mem_AllocWStr (WORD nChar)
 
CSTR mem_FreeStr (CSTR Dup)
 
ASTR mem_ADupWStr (WCSTR WStr, UINT CodePg=CP_ACP, UINT ccExtra=0)
 
WSTR mem_WDupAStr (ACSTR AStr, UINT CodePg=CP_ACP, UINT ccExtra=0)
 
PUNICODE_STRING mem_AllocUniStr (WORD ccStr, OPTOUT PULONG cbAlloc)
 
ACSTR _MBStr (WCSTR pWStr)
 
CSTR LoadStr (HMODULE hModule, UINT Id, TSTR Buf=NULL, UINT Count=0)
 
WCSTR GetResourceStr (HMODULE hModule, UINT Id, PWORD pCount)
 
WCSTR FindResourceStrEx (HMODULE hModule, UINT Id, LANGID Lang, PWORD pCount)
 
CSTR DupResourceStrEx (HMODULE hModule, UINT Id, LANGID Lang, PWORD pCount)
 
CSTR FreeResourceStrEx (CSTR pzRcDupStr)
 
UINT EnumerateMultiSzA (ASTR MultiSz, PFnEnumMultiStringA Action, PVOID Context)
 
UINT EnumerateMultiSzW (WSTR MultiSz, PFnEnumMultiStringW Action, PVOID Context)
 
UINT MultiSzLengthA (ACSTR MultiSz)
 
UINT MultiSzLengthW (WCSTR MultiSz)
 
UINT MultiSzCountA (ACSTR MultiSz)
 
UINT MultiSzCountW (WCSTR MultiSz)
 
TSTR MultiCrLfToLf (TSTR pText)
 
TSTR LinesToMultiSz (TSTR pText, UINT *ccSz)
 
TSTR MultiSzToLines (TSTR pText)
 
TSTR DuplicateMultiSz (CSTR pzMulti)
 
TSTR FreeMultiSz (TSTR pzMulti)
 
bool SplitUncPath (IN CSTR UncPath, OUT TSTR Svr, UINT ccSvr, OUT TSTR Share, UINT ccShare, OPTOUT TSTR Path=NULL, UINT ccPath=0)
 
bool SplitNetShareName (IN CSTR ShareName, OUT WSTR Server, UINT ccServer, OUT WSTR Share, UINT ccShare)
 
CSTR WithoutBackslash (CSTR PathName)
 
CSTR WithBackslash (CSTR PathName)
 
bool GetRootOf (IN CSTR PathName, OUT TSTR Root, UINT ccRoot)
 
CSTR __cdecl StrFmt (TSTR Buf, UINT ccBuf, CSTR Fmt,...)
 
TSTR ReplaceStrChar (TSTR Str, TCHAR From, TCHAR To, OPTOUT UINT *pCount)
 
bool MatchPattern (CSTR String, CSTR Pattern, bool CaseSens)
 
UINT DeduplicateCharSepText (INOUT ASTR Text, CHAR Separator, bool caseSens, bool emitSorted)
 
UINT PrependString (INOUT TSTR String, UINT ccBuf, OPTIN TCHAR Sep, CSTR Prolog)
 
UINT AppendString (INOUT TSTR String, UINT ccBuf, OPTIN TCHAR Sep, CSTR Epilog)
 
ULONG GetStringHash (WCSTR Str, ULONG Algorithm=0, bool caseSens=true)
 
CSTR HexString (PBYTE pData, UINT dataLen, TSTR strBuf=NULL, UINT bufSize=0, bool tailDots=false)
 
CSTR DataSizeStr (UINT64 Size)
 
CSTR IsoDataSizeStr (UINT64 Size)
 
CSTR FileAttribStr (DWORD Attr)
 
CSTR FileTimeStr (FILETIME *FTime, CSTR Fmt=_T("%Y-%m-%d %H.%M.%S"))
 
CSTR SysTimeStr (SYSTEMTIME *Time, CSTR Fmt)
 
CSTR FileTypeStr (CSTR FName)
 
CSTR EngFormat (long double Value, BYTE nDecimals, CSTR Unit=NULL)
 
CSTR GetGUIDString (REFIID riid, TSTR pzBuf=NULL, UINT ccBuf=0)
 
CSTR GetIIDString (REFIID riid, TSTR pzBuf=NULL, UINT ccBuf=0)
 
CSTR GetCLSIDString (REFIID riid, TSTR pzBuf=NULL, UINT ccBuf=0)
 
CSTR GetCLSIDAppname (REFIID riid, TSTR pzBuf=NULL, UINT ccBuf=0)
 
PUNICODE_STRING _InitUnicodeString (PUNICODE_STRING puStr, PCWSTR pwzSrc)
 
PSTRING _InitString (PSTRING pStr, LPCSTR pzSrc)
 
bool SetUnicodeString (PUNICODE_STRING puStr, WCSTR wzSrc)
 
PUNICODE_STRING InitPackedUnicodeString (PVOID Buffer, USHORT cbBuffer)