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
44public:
45 // member variables
46 // NOLINTBEGIN
47 ::ll::TypedStorage<8, 72, ::FileInfo> mFile;
48 ::ll::TypedStorage<8, 96, ::FileUploadManager::MultiPartStreamHelper> mMultiPartHelper;
49 ::ll::TypedStorage<4, 4, ::UploadState> mState;
50 ::ll::TypedStorage<4, 4, ::UploadError> mUploadError;
51 ::ll::TypedStorage<8, 16, ::std::shared_ptr<::IFilePicker>> mFilePicker;
52 ::ll::TypedStorage<8, 16, ::std::shared_ptr<::IFileChunkUploader>> mFileUploader;
53 ::ll::TypedStorage<8, 8, ::TaskGroup&> mIOTaskGroup;
54 ::ll::TypedStorage<8, 24, ::Bedrock::NonOwnerPointer<::FileArchiver>> mFileArchiver;
55 ::ll::TypedStorage<1, 1, bool> mUploadAllAtOnce;
56 ::ll::TypedStorage<1, 1, bool> mContinueOnReception;
57 ::ll::TypedStorage<1, 1, bool> mUseStream;
58 // NOLINTEND
59
60public:
61 // prevent constructor by default
62 FileUploadManager& operator=(FileUploadManager const&);
63 FileUploadManager(FileUploadManager const&);
64 FileUploadManager();
65
66public:
67 // virtual functions
68 // NOLINTBEGIN
69 virtual ~FileUploadManager();
70
71 virtual float getUploadProgress() const;
72
73#ifdef LL_PLAT_S
74 virtual void archiveAndUploadFileToRealmStorage(
75 ::std::string const& uploadId,
76 ::Core::Path const& path,
77 int const slotIndex,
78 ::std::string const& realmsGuid
79 ) = 0;
80#else // LL_PLAT_C
81 virtual void archiveAndUploadFileToRealmStorage(
82 ::std::string const& uploadId,
83 ::Core::Path const& worldID,
84 int const slotIndex,
85 ::std::string const& realmsGuid
86 ) = 0;
87#endif
88
89 virtual void uploadFileToRealmStorage(::std::string const& uploadId, ::Core::Path const& path, int const slotIndex);
90 // NOLINTEND
91
92public:
93 // member functions
94 // NOLINTBEGIN
95 MCAPI FileUploadManager(::TaskGroup& taskGroup, ::std::shared_ptr<::IFileChunkUploader> fileUploader);
96
97#ifdef LL_PLAT_C
98 MCAPI FileUploadManager(
99 ::TaskGroup& taskGroup,
100 ::std::shared_ptr<::IFileChunkUploader> fileUploader,
101 ::Bedrock::NotNullNonOwnerPtr<::FileArchiver> const& fileArchiver
102 );
103#endif
104
105 MCAPI void _uploadChunk(::FileChunkInfo const& chunk);
106
107 MCAPI void addCallbackQueue(::std::function<void()> callback);
108
109 MCAPI void uploadFile(
110 ::std::string const& uploadId,
111 ::Core::Path const& filePath,
112 bool autoStartUpload,
113 ::Json::Value const& uploadOptions
114 );
115 // NOLINTEND
116
117public:
118 // static variables
119 // NOLINTBEGIN
120 MCAPI static ::std::string const& BOUNDARY();
121 // NOLINTEND
122
123public:
124 // constructor thunks
125 // NOLINTBEGIN
126 MCAPI void* $ctor(::TaskGroup& taskGroup, ::std::shared_ptr<::IFileChunkUploader> fileUploader);
127
128#ifdef LL_PLAT_C
129 MCAPI void* $ctor(
130 ::TaskGroup& taskGroup,
131 ::std::shared_ptr<::IFileChunkUploader> fileUploader,
132 ::Bedrock::NotNullNonOwnerPtr<::FileArchiver> const& fileArchiver
133 );
134#endif
135 // NOLINTEND
136
137public:
138 // destructor thunk
139 // NOLINTBEGIN
140 MCAPI void $dtor();
141 // NOLINTEND
142
143public:
144 // virtual function thunks
145 // NOLINTBEGIN
146 MCAPI float $getUploadProgress() const;
147
148 MCAPI void $uploadFileToRealmStorage(::std::string const& uploadId, ::Core::Path const& path, int const slotIndex);
149
150
151 // NOLINTEND
152};
Definition Path.h:11
Definition FileArchiver.h:35
Definition IFileChunkUploader.h:15
Definition IFilePicker.h:11
Definition Value.h:16
Definition TaskGroup.h:86
Definition FileChunkInfo.h:5
Definition FileUploadManager.h:30