getDate method

String getDate()

Gets the the document's date of first issue, in the form YYYY-MM-DD.

return The document's date of first issue, in the form YYYY-MM-DD. throws DocumentException An error has occurred during Document Library execution.

Implementation

String getDate() {
  Pointer<Char> pDate = nullptr;
  Pointer<Int> pDateSize = calloc.allocate(1);
  pDateSize[0] = -1;
  try {
    var err = documentSDK.id3DocumentInfo_GetDate(_pHandle.value, pDate, pDateSize);
    if (err == DocumentError.insufficientBuffer.value) {
      pDate = calloc.allocate(pDateSize.value);
      err = documentSDK.id3DocumentInfo_GetDate(_pHandle.value, pDate, pDateSize);
      if (err != DocumentError.success.value) {
        throw DocumentException(err);
      }
    }
    final vDate = utf8.decode(Uint8List.fromList(pDate.cast<Uint8>().asTypedList(pDateSize.value)));
    return vDate;
  } finally {
    calloc.free(pDate);
    calloc.free(pDateSize);
  }
}