Commit Graph

12 Commits

Author SHA1 Message Date
Pablo Curiel 32c097c055 [ci skip] Add GameCardImageDumpTask and FileWriter classes
GameCardImageDumpTask is a derived class of DataTransferTask, and it's designed to dump a gamecard image using the options selected by the user (which must be passed from a GameCardImageDumpOptionsFrame object). It uses std::optional<std::string> as its return type -- the idea behind this is to return error strings that may later be displayed by an ErrorFrame during the dump process (views not yet implemented).

FileWriter is a class that encapsulates write operations to different storage mediums (SD card, USB host and UMS devices), based on the provided input path. It is used by GameCardImageDumpTask to painlessly write data to the right output storage without explicitly having to implement multiple code paths for all storage types as part of the actual dump code. Furthermore, FileWriter also supports writing split files to FAT-formatted UMS devices if an output file is >= 4 GiB -- part file handling is completely abstracted away from any callers.

Other changes include:

* AsyncTask: rename all class methods to use PascalCase naming.
* AsyncTask: rename get() -> GetResult().

* DataTransferTask: reflect the changes made to AsyncTask.
* DataTransferTask: pause the RepeatingTask right after LoopCallback() returns true instead of pausing it in the cancel/post-execute callbacks.
* DataTransferTask: add private FormatTimeString() method.
* DataTransferTask: remove superfluous override for DoInBackground() -- classes derived from DataTransferTask must provide it on their own, anyway.
* DataTransferTask: add public GetDurationString() method.

* defines: update FAT32_FILESIZE_LIMIT macro to use UINT32_MAX.
* defines: add CONCATENATION_FILE_PART_SIZE macro (used by the new FileWriter class).

* DownloadTask: reflect the changes made to AsyncTask.

* DumpOptionsFrame: file extension is no longer stored as a class member, nor required by the class constructor.
* DumpOptionsFrame: change the return type for GetOutputFilePath() to bool. The method now saves its output to a variable passed by reference.

* GameCardImageDumpOptionsFrame: reflect the changes made to DumpOptionsFrame.

* i18n: update localization strings where applicable.

* nxdt_utils: fix a potential buffer overflow in utilsGetFileSystemStatsByPath().

* OptionsTab: reflect the changes made to AsyncTask.

* usb: add const qualifier to the input buffer required by usbSendFileData().
* usb: add const qualifier to the input buffer required by usbSendNspHeader().
2024-04-25 01:49:04 +02:00
Pablo Curiel 6dfbb301df [ci skip] Remove void keyword from C++ ctors/dtors 2024-04-19 12:08:44 +02:00
Pablo Curiel 9525f37e51 [ci skip] Add DataTransfer* classes.
Adds the DataTransferTask and DataTransferProgressDisplay classes, which use repurposed logic from the DownloadTask and EtaProgressDisplay classes, respectively. The EtaProgressDisplay class and EtaProgressInfo struct have been removed.

Other changes include:

* DownloadTask: heavily simplified logic by using DataTransferTask as the base class.

* DumpOptionsFrame: implement some additional/experimental changes.

* OptionsTab: update logic to use the new DataTransferProgressDisplay class.
2024-04-15 01:53:43 +02:00
Pablo Curiel fc5226bfce [skip ci] Update copyright year. 2024-04-12 11:49:03 +02:00
Pablo Curiel 9a4b8b573d Update copyright year 2023-04-08 13:42:22 +02:00
Pablo Curiel 7e399d91db Update dependencies.
* Update libusbhsfs to 8c2e517. Furthermore, the UMS handler has been rewritten to use the new callback-based system from libusbhsfs.

* Update FatFs to R0.15 w/patch2.
2023-02-24 21:32:58 +01:00
Pablo Curiel 942a407247 Codebase cleanup.
Remove legacy code and trailing whitespace from all files.
2022-07-05 03:04:28 +02:00
Pablo Curiel 2fa61dc228 Update copyright year. 2022-03-17 13:58:40 +01:00
Pablo Curiel 962cf00ba9 Display a CrashFrame warning at startup if the application is running under applet mode.
Other changes include:

* defines: added NON_MOVEABLE macro.
* AsyncTask: set class as non-moveable, too.
* RootView: provide an override for getDefaultFocus().
* StatusInfoTask: replace GetStatusInfoData with IsInternetConnectionAvailable().
2021-07-30 17:07:26 -04:00
Pablo Curiel f80573e5c4 Move DownloadTask classes to their own header file. 2021-07-27 19:47:12 -04:00
Pablo Curiel eb97ae3de5 Implement DownloadTask, DownloadFileTask and DownloadDataTask classes.
Other changes include:

* AsyncTask: use a recursive mutex instead of atomics. Fixes build issues related to non-trivially-copyable elements.
* http: remove CURLOPT_ACCEPT_ENCODING option in httpPerformGetRequest().
2021-07-27 11:00:09 -04:00
Pablo Curiel 05dec93795 Implemented AsyncTask class.
Other changes include:

* Updated borealis.
* Updated Makefile.
* Began implementation of a (very) simple, CURL-based HTTP handler.
* OptionsTab: added a small disclaimer about dump options.
* OptionsTab:  added notifications for the update application item (running as NSO, app already updated).
* config: improved boundary handling while validating integer entries.
* utils: (de)initialize CURL (this will be moved to http.c eventually).
2021-07-25 01:37:13 -04:00