LeviLamina
Loading...
Searching...
No Matches
FileUploadManager.h
1#pragma once
2
3#include "mc/_HeaderOutputPredefine.h"
4
5// auto generated inclusion list
6#include "mc/deps/core/utility/NonOwnerPointer.h"
7#include "mc/util/FileInfo.h"
8#include "mc/util/UploadError.h"
9#include "mc/util/UploadState.h"
10
11// auto generated forward declare list
12// clang-format off
13class FileArchiver;
15class IFilePicker;
16class TaskGroup;
17struct FileChunkInfo;
18namespace Core { class Path; }
19namespace Json { class Value; }
20// clang-format on
21
22class FileUploadManager : public ::std::enable_shared_from_this<::FileUploadManager> {
23public:
24 // FileUploadManager inner types declare
25 // clang-format off
27 // clang-format on
28
29 // FileUploadManager inner types define
31 public:
32 // member variables
33 // NOLINTBEGIN
34 ::ll::TypedStorage<1, 1, bool> needHeader;
35 ::ll::TypedStorage<1, 1, bool> needTrailer;
36 ::ll::TypedStorage<8, 32, ::std::string> header;
37 ::ll::TypedStorage<8, 32, ::std::string> trailer;
38 ::ll::TypedStorage<8, 8, uint64> currentFileByte;
39 ::ll::TypedStorage<8, 8, uint64> totalFileByte;
40 ::ll::TypedStorage<8, 8, uint64> totalStreamSize;
41 // NOLINTEND
42
43 public:
44 // member functions
45 // NOLINTBEGIN
47 // NOLINTEND
48
49 public:
50 // destructor thunk
51 // NOLINTBEGIN
52 MCFOLD void $dtor();
53 // NOLINTEND
54 };
55
56public:
57 // member variables
58 // NOLINTBEGIN
59 ::ll::TypedStorage<8, 72, ::FileInfo> mFile;
60 ::ll::TypedStorage<8, 96, ::FileUploadManager::MultiPartStreamHelper> mMultiPartHelper;
61 ::ll::TypedStorage<4, 4, ::UploadState> mState;
62 ::ll::TypedStorage<4, 4, ::UploadError> mUploadError;
63 ::ll::TypedStorage<8, 16, ::std::shared_ptr<::IFilePicker>> mFilePicker;
64 ::ll::TypedStorage<8, 16, ::std::shared_ptr<::IFileChunkUploader>> mFileUploader;
65 ::ll::TypedStorage<8, 8, ::TaskGroup&> mIOTaskGroup;
66 ::ll::TypedStorage<8, 24, ::Bedrock::NonOwnerPointer<::FileArchiver>> mFileArchiver;
67 ::ll::TypedStorage<1, 1, bool> mUploadAllAtOnce;
68 ::ll::TypedStorage<1, 1, bool> mContinueOnReception;
69 ::ll::TypedStorage<1, 1, bool> mUseStream;
70 // NOLINTEND
71
72public:
73 // prevent constructor by default
74 FileUploadManager& operator=(FileUploadManager const&);
75 FileUploadManager(FileUploadManager const&);
76 FileUploadManager();
77
78public:
79 // virtual functions
80 // NOLINTBEGIN
81 virtual ~FileUploadManager();
82
83 virtual float getUploadProgress() const;
84
85 virtual void archiveAndUploadFileToRealmStorage(
86 ::std::string const& uploadId,
87 ::Core::Path const& path,
88 int const slotIndex,
89 ::std::string const& realmsGuid
90 ) = 0;
91
92 virtual void uploadFileToRealmStorage(::std::string const& uploadId, ::Core::Path const& path, int const slotIndex);
93 // NOLINTEND
94
95public:
96 // member functions
97 // NOLINTBEGIN
98 MCAPI FileUploadManager(::TaskGroup& taskGroup, ::std::shared_ptr<::IFileChunkUploader> fileUploader);
99
100#ifdef LL_PLAT_C
101 MCAPI FileUploadManager(
102 ::TaskGroup& taskGroup,
103 ::std::shared_ptr<::IFileChunkUploader> fileUploader,
104 ::Bedrock::NotNullNonOwnerPtr<::FileArchiver> const& fileArchiver
105 );
106#endif
107
108 MCAPI void _generateMultiPartHelper();
109
110 MCAPI void _resumeUpload();
111
112 MCAPI void _uploadChunk(::FileChunkInfo const& chunk);
113
114 MCAPI void _uploadStream();
115
116 MCAPI void addCallbackQueue(::std::function<void()> callback);
117
118#ifdef LL_PLAT_C
119 MCAPI void setFailed(::UploadError reason);
120#endif
121
122 MCAPI void uploadFile(
123 ::std::string const& uploadId,
124 ::Core::Path const& filePath,
125 bool autoStartUpload,
126 ::Json::Value const& uploadOptions
127 );
128 // NOLINTEND
129
130public:
131 // static variables
132 // NOLINTBEGIN
133 MCAPI static ::std::string const& BOUNDARY();
134 // NOLINTEND
135
136public:
137 // constructor thunks
138 // NOLINTBEGIN
139 MCAPI void* $ctor(::TaskGroup& taskGroup, ::std::shared_ptr<::IFileChunkUploader> fileUploader);
140
141#ifdef LL_PLAT_C
142 MCAPI void* $ctor(
143 ::TaskGroup& taskGroup,
144 ::std::shared_ptr<::IFileChunkUploader> fileUploader,
145 ::Bedrock::NotNullNonOwnerPtr<::FileArchiver> const& fileArchiver
146 );
147#endif
148 // NOLINTEND
149
150public:
151 // destructor thunk
152 // NOLINTBEGIN
153 MCAPI void $dtor();
154 // NOLINTEND
155
156public:
157 // virtual function thunks
158 // NOLINTBEGIN
159 MCAPI float $getUploadProgress() const;
160
161 MCAPI void $uploadFileToRealmStorage(::std::string const& uploadId, ::Core::Path const& path, int const slotIndex);
162
163
164 // NOLINTEND
165
166public:
167 // vftables
168 // NOLINTBEGIN
169 MCNAPI static void** $vftable();
170 // NOLINTEND
171};
Definition Path.h:17
Definition FileArchiver.h:36
static MCAPI void ** $vftable()
Definition IFileChunkUploader.h:15
Definition IFilePicker.h:11
Definition Value.h:16
Definition TaskGroup.h:57
Definition FileChunkInfo.h:5
Definition FileUploadManager.h:30