mdz_ansi_copySubAnsi_async - maxdz-gmbh/mdz_string GitHub Wiki
Fills pSubAnsi
with items from pAnsi
, starting from nLeftPos
and ending with one of pSeparators or nRightPos
.
size_t mdz_ansi_copySubAnsi_async(
const struct mdz_Ansi* pAnsi,
size_t nLeftPos,
size_t nRightPos,
const char* pcSeparators,
size_t nSeparatorsCount,
struct mdz_Ansi* pSubAnsi,
struct mdz_asyncData* pAsyncData);
Synchronous version:
mdz_ansi_copySubAnsi(pAnsi, nLeftPos, nRightPos, pcSeparators, nSeparatorsCount, pSubAnsi);
Parameter | Description |
---|---|
pAnsi |
pointer to string returned by mdz_ansi_create() or mdz_ansi_create_attached()
|
nLeftPos |
0-based start position to get items from. Use 0 to start from the beginning of string |
nRightPos |
0-based end position to get items up to. Use Size-1 or -1 to proceed till the end of string |
pcSeparators |
separators to get items up to |
nSeparatorsCount |
number of separators or 0 if pcSeparators until 0-terminator should be used |
pSubAnsi |
pointer to string where items should be copied. Data in pSubAnsi will be re-reserved to appropriate size if necessary |
pAsyncData |
pointer to shared async data for asynchronous call, or NULL if call should be synchronous |
Return | Description |
---|---|
SIZE_MAX |
if pAnsi == NULL , or pSubAnsi == NULL (MDZ_ERROR_SUBCONTAINER), or reallocation of m_pData in pSubAnsi was necessary but failed (MDZ_ERROR_ALLOCATION) |
Size |
if pcSeparators == NULL (MDZ_ERROR_ITEMS), or nSeparatorsCount == 0 (MDZ_ERROR_ZEROCOUNT), or nLeftPos > nRightPos (MDZ_ERROR_BIGLEFT), or nRightPos >= Size (MDZ_ERROR_BIGRIGHT). No copying is made |
Result | 0-based position after separator if found, or Size if not found |