mdz_ansi_count_async - maxdz-gmbh/mdz_string GitHub Wiki
Counts number of pcItems
substring occurences in string.
size_t mdz_ansi_count_async(
const struct mdz_Ansi* pAnsi,
size_t nLeftPos,
size_t nRightPos,
const char* pcItems,
size_t nCount,
enum mdz_find_method enFindMethod,
mdz_bool bAllowOverlapped,
struct mdz_asyncData* pAsyncData);
Synchronous version:
mdz_ansi_count(pAnsi, nLeftPos, nRightPos, pcItems, nCount, enFindMethod, bAllowOverlapped);
Parameter | Description |
---|---|
pAnsi |
pointer to string returned by mdz_ansi_create() or mdz_ansi_create_attached()
|
nLeftPos |
0-based start position to count from. Use 0 to count from the beginning of string |
nRightPos |
0-based end position to count up to. Use Size-1 or -1 to count till the end of string |
pcItems |
items/substring to count |
nCount |
Size of substring to count or 0 if pcItems until 0-terminator should be used |
enFindMethod |
find method to use. See details in mdz_find_method description |
bAllowOverlapped |
mdz_true if overlapped substrings should be counted, otherwise mdz_false |
pAsyncData |
pointer to shared async data for asynchronous call, or NULL if call should be synchronous |
Return | Description |
---|---|
SIZE_MAX |
if pAnsi == NULL
|
0 | if pcItems == NULL (MDZ_ERROR_ITEMS), or nCount == 0 and pcItems [0] == 0 (MDZ_ERROR_ZEROCOUNT), or nLeftPos > nRightPos (MDZ_ERROR_BIGLEFT), or nRightPos >= Size (MDZ_ERROR_BIGRIGHT), or nCount is too big (MDZ_ERROR_BIGCOUNT), or invalid enFindMethod (MDZ_ERROR_FINDMETHOD). No counting is made |
Result | 0-based count of substring occurences. 0 if not found |