getCountry method
Gets the the ISO 3166-1 alpha-3 code identifying the country issuing the document.
return The ISO 3166-1 alpha-3 code identifying the country issuing the document. throws DocumentException An error has occurred during Document Library execution.
Implementation
String getCountry() {
Pointer<Char> pCountry = nullptr;
Pointer<Int> pCountrySize = calloc.allocate(1);
pCountrySize[0] = -1;
try {
var err = documentSDK.id3DocumentInfo_GetCountry(_pHandle.value, pCountry, pCountrySize);
if (err == DocumentError.insufficientBuffer.value) {
pCountry = calloc.allocate(pCountrySize.value);
err = documentSDK.id3DocumentInfo_GetCountry(_pHandle.value, pCountry, pCountrySize);
if (err != DocumentError.success.value) {
throw DocumentException(err);
}
}
final vCountry = utf8.decode(Uint8List.fromList(pCountry.cast<Uint8>().asTypedList(pCountrySize.value)));
return vCountry;
} finally {
calloc.free(pCountry);
calloc.free(pCountrySize);
}
}