set method

void set(
  1. String? key,
  2. String? item
)

Sets an item of the StringDict object.

param key Unique key of the item to set. param item item to set. throws DocumentException An error has occurred during Document Library execution.

Implementation

void set(String? key, String? item) {
  Pointer<Char>? pKey = key?.toNativeUtf8().cast<Char>();
  Pointer<Char>? pItem = item?.toNativeUtf8().cast<Char>();
  try {
    var err = documentSDK.id3DocumentStringDict_Set(_pHandle.value, pKey ?? nullptr, pItem ?? nullptr);
    if (err != DocumentError.success.value) {
      throw DocumentException(err);
    }
  } finally {
    if (pKey != null) {
      calloc.free(pKey);
    }
    if (pItem != null) {
      calloc.free(pItem);
    }
  }
}