LeviLamina
Loading...
Searching...
No Matches
FileDownloadManager.h
1#pragma once
2
3#include "mc/_HeaderOutputPredefine.h"
4
5// auto generated inclusion list
6#include "mc/util/DownloadError.h"
7#include "mc/util/DownloadState.h"
8#include "mc/util/DownloaderResult.h"
9
10// auto generated forward declare list
11// clang-format off
13class IFilePicker;
14namespace Core { class Path; }
15// clang-format on
16
17class FileDownloadManager : public ::std::enable_shared_from_this<::FileDownloadManager> {
18public:
19 // member variables
20 // NOLINTBEGIN
33 // NOLINTEND
34
35public:
36 // prevent constructor by default
37 FileDownloadManager& operator=(FileDownloadManager const&);
38 FileDownloadManager(FileDownloadManager const&);
39 FileDownloadManager();
40
41public:
42 // virtual functions
43 // NOLINTBEGIN
44#ifdef LL_PLAT_S
45 virtual ~FileDownloadManager() = default;
46#else // LL_PLAT_C
47 virtual ~FileDownloadManager();
48#endif
49
50 virtual void update();
51
52 virtual void cancelDownload();
53
54 virtual float getDownloadProgress() const;
55 // NOLINTEND
56
57public:
58 // member functions
59 // NOLINTBEGIN
60#ifdef LL_PLAT_C
61 MCNAPI FileDownloadManager(
62 ::std::shared_ptr<::IFilePicker> filePicker,
63 ::std::shared_ptr<::IFileChunkDownloader> fileDownloader
64 );
65
66 MCNAPI void _writeData(
67 ::std::vector<uchar> data,
68 uint64 writeBytes,
69 uint64 offset,
70 uint64 progress,
71 ::std::function<void(uint64, bool)> writeComplete
72 );
73
74 MCNAPI bool canCancelDownload() const;
75
76 MCNAPI void downloadFile(
77 ::std::string const& downloadId,
78 ::std::string const& downloadUrl,
79 ::Core::Path const& downloadPath,
80 uint64 expectedFileSize,
81 uint64 fromByteOffset,
82 ::std::string const& downloadVersion,
83 ::std::function<void(::Core::Path const&, ::DownloaderResult)> onCompleteCallback,
84 int slotIndex
85 );
86
87 MCNAPI uint64 getDownloadSize() const;
88
89 MCNAPI ::DownloadState getDownloadState() const;
90
91 MCNAPI ::DownloadError const& getError() const;
92
93 MCNAPI uint64 getFileSize() const;
94
95 MCNAPI void pauseDownload();
96#endif
97 // NOLINTEND
98
99public:
100 // constructor thunks
101 // NOLINTBEGIN
102#ifdef LL_PLAT_C
103 MCNAPI void*
104 $ctor(::std::shared_ptr<::IFilePicker> filePicker, ::std::shared_ptr<::IFileChunkDownloader> fileDownloader);
105#endif
106 // NOLINTEND
107
108public:
109 // destructor thunk
110 // NOLINTBEGIN
111 MCNAPI void $dtor();
112 // NOLINTEND
113
114public:
115 // virtual function thunks
116 // NOLINTBEGIN
117#ifdef LL_PLAT_C
118 MCNAPI void $update();
119
120 MCNAPI void $cancelDownload();
121
122 MCNAPI float $getDownloadProgress() const;
123#endif
124
125
126 // NOLINTEND
127
128public:
129 // vftables
130 // NOLINTBEGIN
131 MCNAPI static void** $vftable();
132 // NOLINTEND
133};
Definition Path.h:12
static MCAPI void ** $vftable()
MCAPI void $dtor()
Definition IFileChunkDownloader.h:14
Definition IFilePicker.h:11
Definition Alias.h:14