getName method
Gets the name of the text field.
return Name of the text field. throws DocumentException An error has occurred during Document Library execution.
Implementation
String getName() {
Pointer<Char> pName = nullptr;
Pointer<Int> pNameSize = calloc.allocate(1);
pNameSize[0] = -1;
try {
var err = documentSDK.id3DocumentTextField_GetName(_pHandle.value, pName, pNameSize);
if (err == DocumentError.insufficientBuffer.value) {
pName = calloc.allocate(pNameSize.value);
err = documentSDK.id3DocumentTextField_GetName(_pHandle.value, pName, pNameSize);
if (err != DocumentError.success.value) {
throw DocumentException(err);
}
}
final vName = utf8.decode(Uint8List.fromList(pName.cast<Uint8>().asTypedList(pNameSize.value)));
return vName;
} finally {
calloc.free(pName);
calloc.free(pNameSize);
}
}