get method
- int index
Gets an item of the StringList object.
param index Index of the item to get. return item to get. throws FaceException An error has occurred during Face Library execution.
Implementation
String get(int index) {
Pointer<Char> pItem = nullptr;
Pointer<Int> pItemSize = calloc.allocate(1);
pItemSize[0] = -1;
try {
var err = faceSDK.id3FaceStringList_Get(_pHandle.value, index, pItem, pItemSize);
if (err == FaceError.insufficientBuffer.value) {
pItem = calloc.allocate(pItemSize.value);
err = faceSDK.id3FaceStringList_Get(_pHandle.value, index, pItem, pItemSize);
if (err != FaceError.success.value) {
throw FaceException(err);
}
}
final vItem = utf8.decode(Uint8List.fromList(pItem.cast<Uint8>().asTypedList(pItemSize.value)));
return vItem;
} finally {
calloc.free(pItem);
calloc.free(pItemSize);
}
}