getLicensePath static method

String getLicensePath()

Retrieves the license path.

return The license path. throws DocumentException An error has occurred during Document Library execution.

Implementation

static String getLicensePath() {
  Pointer<Char> pLicensePath = calloc.allocate(256);
  Pointer<Int> pLicensePathSize = calloc.allocate(1);
  pLicensePathSize[0] = 256;
  try {
    var err = documentSDK.id3DocumentLicense_GetLicensePath(pLicensePath, pLicensePathSize);
    if (err == DocumentError.insufficientBuffer.value) {
      calloc.free(pLicensePath);
      pLicensePath = calloc.allocate(pLicensePathSize.value);
      err = documentSDK.id3DocumentLicense_GetLicensePath(pLicensePath, pLicensePathSize);
      if (err != DocumentError.success.value) {
        throw DocumentException(err);
      }
    }
    final vLicensePath = utf8.decode(Uint8List.fromList(pLicensePath.cast<Uint8>().asTypedList(pLicensePathSize.value)));
    return vLicensePath;
  } finally {
    calloc.free(pLicensePath);
    calloc.free(pLicensePathSize);
  }
}