mdz_utf8_insertAnsi_string_async - maxdz-gmbh/mdz_unicode GitHub Wiki
Insert ASCII/ANSI string pAnsiSource
in string. Characters are converted to UTF-8
characters before isertion. Size
grows on added bytes. Length
grows on added symbols count.
String reserved area and pAnsiSource
->m_pData
should not overlap.
mdz_bool mdz_utf8_insertAnsi_string_async(
struct mdz_Utf8* pUtf8,
size_t nLeftPos,
const void* pAnsiSource,
mdz_bool bReserve,
struct mdz_asyncData* pAsyncData);
Synchronous version:
mdz_utf8_insertAnsi_string(pUtf8, nLeftPos, pAnsiSource, bReserve);
Parameter | Description |
---|---|
pUtf8 |
pointer to string returned by mdz_utf8_create() or mdz_utf8_create_attached()
|
nLeftPos |
0-based position to insert in symbols. If nLeftPos == Length or -1, items are appended. nLeftPos > Length is not allowed |
pAnsiSource |
pointer to ASCII/ANSI string to insert. String is returned by mdz_ansi_create() or mdz_ansi_create_attached() |
bReserve |
if mdz_true reserve capacity when there is not enough space for insertion, otherwise mdz_false |
pAsyncData |
pointer to shared async data for asynchronous call, or NULL if call should be synchronous |
Return | Description |
---|---|
mdz_false | if pUtf8 == NULL
|
mdz_false | if bReserve == mdz_true and memory allocation failed (MDZ_ERROR_ALLOCATION) |
mdz_false | if bReserve == mdz_true and there is not enough capacity for inserted data, but m_pData is attached using mdz_utf8_attachData() (MDZ_ERROR_ATTACHED) |
mdz_false | if bReserve == mdz_false and there is not enough free Capacity in the string (MDZ_ERROR_CAPACITY) |
mdz_false | if string reserved area and pAnsiSource ->m_pData overlap (MDZ_ERROR_OVERLAP) |
mdz_true | if pAnsiSource == NULL (MDZ_ERROR_SOURCE), or pAnsiSource .Size == 0 (MDZ_ERROR_ZEROCOUNT), or nLeftPos > Length (MDZ_ERROR_BIGLEFT). No insertion is made |
mdz_true | insertion succeeded |