Using OnReadUserFileDelegates

How do I use OnReadUserFileDelegates to trigger a function once the file has been read? Or am I completely looking in the wrong place for wanting to do this?

For example I am reading a file from ‘the cloud’ using IOnlineUserCloud::ReadUserFile, but I don’t want to copy the contents of that file using IOnlineUserCloud::GetFileContents until the file has finished being read from the cloud hence why I only want to trigger GetFileContents upon ReadUserFile (which is a asynchronous task) completing. Any suggestions?

You can do this:

auto cloudReadCallback = FOnReadUserFileCompleteDelegate::CreateLambda([&](bool success, const FUniqueNetId& uniqueId, const FString& filename)
{
	if (success)
	{
		// Load file contents here
	}
});
userCloud->AddOnReadUserFileCompleteDelegate_Handle(cloudReadCallback);

Wasn’t easy to find…