Skip to content

mdz_ansi_insert_async

Maksym Dzyubenko edited this page Feb 7, 2024 · 1 revision

Insert nCount items in string. String m_pData and pItems cannot overlap, if reservation is allowed. Size grows on nCount.

mdz_bool mdz_ansi_insert_async(
  struct mdz_Ansi* pAnsi,
  size_t nLeftPos,
  const char* pcItems,
  size_t nCount,
  mdz_bool bReserve,
  struct mdz_asyncData* pAsyncData);

Synchronous version:
mdz_ansi_insert(pAnsi, nLeftPos, pcItems, nCount, bReserve);

Parameter Description
pAnsi pointer to string returned by mdz_ansi_create() or mdz_ansi_create_attached()
nLeftPos 0-based position to insert. If nLeftPos == Size or -1, items are appended. nLeftPos > Size is not allowed
pcItems items to insert
nCount number of items to insert 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 pAnsi == 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_ansi_attachData() (MDZ_ERROR_ATTACHED)
mdz_false if bReserve == mdz_false and there is not enough free Capacity in the string (MDZ_ERROR_CAPACITY)
mdz_true if pcItems == NULL (MDZ_ERROR_ITEMS), or nCount == 0 and pcItems[0] == 0 (MDZ_ERROR_ZEROCOUNT), or nLeftPos > Size (MDZ_ERROR_BIGLEFT), or nCount is too big (MDZ_ERROR_BIGCOUNT). No insertion is made
mdz_true insertion succeeded
mdz_ansi API Reference is generated using mdzApiRefGenerator.

mdz_string functions

mdz_ansi functions

mdz_utf8 functions

mdz_wchar functions

mdz_utf16 functions

mdz_utf32 functions

mdz_string API Reference is generated using mdzApiRefGenerator.
Clone this wiki locally