supertux icon indicating copy to clipboard operation
supertux copied to clipboard

`Downloader`: Asynchronous downloading to memory, apply to release checker

Open Vankata453 opened this issue 1 year ago • 0 comments

Transfer is now a base class for two new derived classes: FileTransfer and StringTransfer. FileTransfer has the same functionality which Transfer had before - it writes received data to a file. StringTransfer, however, appends received data to a referenced string. These additions are also supported by WASM (NOTE: Needs to be tested).

A StringTransfer, which is requested by calling Downloader::request_string_download(), is now used for downloading the "supertux-versioninfo" file, used by the in-game release checker.

Additionally:

  • WASM now supports downloaders, other than the AddonManager one, by providing a pointer to the current Downloader (NOTE: Needs to be tested).
  • Support for parent TransferStatusLists has been added to all Downloader functions.
  • ReaderDocument now contains the from_string() static function, which is a convenience wrapper around from_stream(), where a stream, which only has the given string in its buffer, is provided.

Closes #2627.

Vankata453 avatar Aug 08 '24 18:08 Vankata453