getDocumentScope method

String getDocumentScope()

Gets the the identification code of the scope on which the document type is defined. For AFNOR XP Z42-101 only.

return The identification code of the scope on which the document type is defined. For AFNOR XP Z42-101 only. throws BiosealException An error has occurred during Bioseal Library execution.

Implementation

String getDocumentScope() {
  Pointer<Char> pDocumentScope = nullptr;
  Pointer<Int> pDocumentScopeSize = calloc.allocate(1);
  pDocumentScopeSize[0] = -1;
  try {
    var err = biosealSDK.id3Bioseal_GetDocumentScope(_pHandle.value, pDocumentScope, pDocumentScopeSize);
    if (err == BiosealError.insufficientBuffer.value) {
      pDocumentScope = calloc.allocate(pDocumentScopeSize.value);
      err = biosealSDK.id3Bioseal_GetDocumentScope(_pHandle.value, pDocumentScope, pDocumentScopeSize);
      if (err != BiosealError.success.value) {
        throw BiosealException(err);
      }
    }
    final vDocumentScope = utf8.decode(Uint8List.fromList(pDocumentScope.cast<Uint8>().asTypedList(pDocumentScopeSize.value)));
    return vDocumentScope;
  } finally {
    calloc.free(pDocumentScope);
    calloc.free(pDocumentScopeSize);
  }
}