mdz_utf32_insertUtf8_async - maxdz-gmbh/mdz_unicode GitHub Wiki
Insert nCount
UTF-8
characters in string. UTF-8
characters are converted to UTF-32
characters before isertion. Size
grows on added UTF-32
characters count. Length
grows on added symbols count.
String reserved area and pcItems
should not overlap.
mdz_bool mdz_utf32_insertUtf8_async(
struct mdz_Utf32* pUtf32,
size_t nLeftPos,
const unsigned char* pcItems,
size_t nCount,
mdz_bool bReserve,
struct mdz_asyncData* pAsyncData);
Synchronous version:
mdz_utf32_insertUtf8(pUtf32, nLeftPos, pcItems, nCount, bReserve);
Parameter | Description |
---|---|
pUtf32 |
pointer to string returned by mdz_utf32_create() or mdz_utf32_create_attached()
|
nLeftPos |
0-based position to insert in symbols. If nLeftPos == Length or -1, items are appended. nLeftPos > Length is not allowed |
pcItems |
UTF-8 characters to insert |
nCount |
number of UTF-8 characters to insert in bytes or 0 if pcItems until 0-terminator should be used |
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 pUtf32 is 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_utf32_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 pcItems contain invalid UTF-8 character(s) (MDZ_ERROR_CONTENT) |
mdz_false | if string reserved area and pcItems overlap (MDZ_ERROR_OVERLAP) |
mdz_true | if pcItems == NULL (MDZ_ERROR_ITEMS), or nCount == 0 (MDZ_ERROR_ZEROCOUNT), or nLeftPos > Length (MDZ_ERROR_BIGLEFT). No insertion is made |
mdz_true | insertion succeeded |