getVersion static method
Retrieves the library version as a 'X.Y.Z' formatted string.
return A string that identifies the library version. throws DocumentException An error has occurred during Document Library execution.
Implementation
static String getVersion() {
Pointer<Char> pLibraryVersion = calloc.allocate(8);
Pointer<Int> pLibraryVersionSize = calloc.allocate(1);
pLibraryVersionSize[0] = 8;
try {
var err = documentSDK.id3DocumentLibrary_GetVersion(pLibraryVersion, pLibraryVersionSize);
if (err == DocumentError.insufficientBuffer.value) {
calloc.free(pLibraryVersion);
pLibraryVersion = calloc.allocate(pLibraryVersionSize.value);
err = documentSDK.id3DocumentLibrary_GetVersion(pLibraryVersion, pLibraryVersionSize);
if (err != DocumentError.success.value) {
throw DocumentException(err);
}
}
final vLibraryVersion = utf8.decode(Uint8List.fromList(pLibraryVersion.cast<Uint8>().asTypedList(pLibraryVersionSize.value)));
return vLibraryVersion;
} finally {
calloc.free(pLibraryVersion);
calloc.free(pLibraryVersionSize);
}
}