LeviLamina
Loading...
Searching...
No Matches
FileArchiver.h
1#pragma once
2
3#include "mc/_HeaderOutputPredefine.h"
4
5// auto generated inclusion list
6#include "mc/deps/core/file/ZipProgress.h"
7#include "mc/deps/core/threading/IAsyncResult.h"
8#include "mc/deps/core/utility/EnableNonOwnerReferences.h"
9#include "mc/deps/core/utility/NonOwnerPointer.h"
10#include "mc/world/level/FileArchiverOutcome.h"
11
12// auto generated forward declare list
13// clang-format off
16class ILevelListCache;
18class Level;
19class LevelData;
20class LevelDbEnv;
21class PackInstance;
22class Scheduler;
23namespace Core { class FilePathManager; }
24namespace Core { class Path; }
25// clang-format on
26
28public:
29 // FileArchiver inner types declare
30 // clang-format off
31 struct CopyWorldResult;
32 struct EduCloudImportInfo;
33 struct ExportData;
34 class IWorldConverter;
35 struct ImportWorldsResult;
36 class ProgressReporter;
37 struct Result;
38 // clang-format on
39
40 // FileArchiver inner types define
41 enum class State : int {
42 Idle = 0,
43 Importing = 1,
44 Exporting = 2,
45 };
46
47 enum class ExportType : int {
48 Level = 0,
49 Template = 1,
50 Project = 2,
51 PlayableEditorLevel = 3,
52 PackagedLevel = 4,
53 };
54
55 enum class ShowToast : int {
56 Enabled = 0,
57 Disabled = 1,
58 };
59
60 struct Result {
61 public:
62 // member variables
63 // NOLINTBEGIN
68 // NOLINTEND
69
70 public:
71 // prevent constructor by default
72 Result& operator=(Result const&);
73 Result(Result const&);
74 Result();
75
76 public:
77 // member functions
78 // NOLINTBEGIN
79 MCAPI ~Result();
80 // NOLINTEND
81
82 public:
83 // destructor thunk
84 // NOLINTBEGIN
85 MCFOLD void $dtor();
86 // NOLINTEND
87 };
88
89 struct ExportData {
90 public:
91 // member variables
92 // NOLINTBEGIN
98 // NOLINTEND
99
100 public:
101 // prevent constructor by default
102 ExportData& operator=(ExportData const&);
103 ExportData(ExportData const&);
104
105 public:
106 // member functions
107 // NOLINTBEGIN
108 MCAPI ExportData();
109 // NOLINTEND
110
111 public:
112 // constructor thunks
113 // NOLINTBEGIN
114 MCAPI void* $ctor();
115 // NOLINTEND
116 };
117
119 public:
120 // member variables
121 // NOLINTBEGIN
125 // NOLINTEND
126
127 public:
128 // prevent constructor by default
129 CopyWorldResult& operator=(CopyWorldResult const&);
132 };
133
135 public:
136 // member variables
137 // NOLINTBEGIN
141 // NOLINTEND
142
143 public:
144 // prevent constructor by default
145 ProgressReporter& operator=(ProgressReporter const&);
148
149 public:
150 // virtual functions
151 // NOLINTBEGIN
152 // vIndex: 0
153 virtual ~ProgressReporter() /*override*/;
154
155 // vIndex: 1
156 virtual void clear() /*override*/;
157 // NOLINTEND
158
159 public:
160 // member functions
161 // NOLINTBEGIN
162 MCAPI void setProgressMessage(::std::string const& message);
163 // NOLINTEND
164
165 public:
166 // destructor thunk
167 // NOLINTBEGIN
168 MCAPI void $dtor();
169 // NOLINTEND
170
171 public:
172 // virtual function thunks
173 // NOLINTBEGIN
174 MCAPI void $clear();
175 // NOLINTEND
176
177 public:
178 // vftables
179 // NOLINTBEGIN
180 MCAPI static void** $vftableForZipProgress();
181
182 MCAPI static void** $vftableForEnableNonOwnerReferences();
183 // NOLINTEND
184 };
185
187 public:
188 // virtual functions
189 // NOLINTBEGIN
190 // vIndex: 0
191 virtual ~IWorldConverter() = default;
192
193 // vIndex: 1
194 virtual void
195 enqueueConvertImportingWorldTasks(::std::shared_ptr<::FileArchiver::Result>&, ::Bedrock::NotNullNonOwnerPtr<::FileArchiver::ProgressReporter>, ::std::shared_ptr<::Bedrock::Threading::IAsyncResult<void>>&) = 0;
196
197 // vIndex: 2
198 virtual bool shouldCopyWorldForConversion(::std::string const&) const = 0;
199
200 // vIndex: 3
201 virtual void
202 enqueueConvertExportingWorldTasks(::std::shared_ptr<::FileArchiver::ExportData>&, ::Bedrock::NotNullNonOwnerPtr<::FileArchiver::ProgressReporter>, ::std::shared_ptr<::Bedrock::Threading::IAsyncResult<void>>&, ::std::function<void(::LevelData&)>) = 0;
203 // NOLINTEND
204
205 public:
206 // destructor thunk
207 // NOLINTBEGIN
208
209 // NOLINTEND
210
211 public:
212 // virtual function thunks
213 // NOLINTBEGIN
214
215 // NOLINTEND
216 };
217
219 public:
220 // ImportWorldsResult inner types declare
221 // clang-format off
222 struct ImportWorldResult;
223 // clang-format on
224
225 // ImportWorldsResult inner types define
227 public:
228 // member variables
229 // NOLINTBEGIN
232 // NOLINTEND
233
234 public:
235 // prevent constructor by default
236 ImportWorldResult& operator=(ImportWorldResult const&);
239 };
240
241 public:
242 // member variables
243 // NOLINTBEGIN
246 // NOLINTEND
247
248 public:
249 // prevent constructor by default
250 ImportWorldsResult& operator=(ImportWorldsResult const&);
253 };
254
256 public:
257 // member variables
258 // NOLINTBEGIN
264 // NOLINTEND
265
266 public:
267 // prevent constructor by default
268 EduCloudImportInfo& operator=(EduCloudImportInfo const&);
271
272 public:
273 // member functions
274 // NOLINTBEGIN
275 MCAPI ~EduCloudImportInfo();
276 // NOLINTEND
277
278 public:
279 // destructor thunk
280 // NOLINTBEGIN
281 MCFOLD void $dtor();
282 // NOLINTEND
283 };
284
285public:
286 // member variables
287 // NOLINTBEGIN
302 // NOLINTEND
303
304public:
305 // prevent constructor by default
306 FileArchiver& operator=(FileArchiver const&);
308 FileArchiver();
309
310public:
311 // virtual functions
312 // NOLINTBEGIN
313 // vIndex: 0
314 virtual ~FileArchiver() /*override*/;
315
316 // vIndex: 1
317 virtual ::std::shared_ptr<::FilePickerSettings> generateFilePickerSettings(
318 ::std::vector<::FileArchiver::ExportType> const& types,
319 ::std::string const& worldId
320 ) const;
321 // NOLINTEND
322
323public:
324 // member functions
325 // NOLINTBEGIN
326 MCAPI FileArchiver(
327 ::Scheduler& scheduler,
328 ::ILevelListCache& levelListCache,
329 ::Bedrock::NotNullNonOwnerPtr<::Core::FilePathManager> const& pathManager,
330 ::Bedrock::NotNullNonOwnerPtr<::IResourcePackRepository> const& resourcePackRepository,
331 bool isEditorModeEnabled,
332 ::std::unique_ptr<::FileArchiver::IWorldConverter> worldConverter,
333 ::Bedrock::NotNullNonOwnerPtr<::IContentKeyProvider const> keyProvider,
334 ::Bedrock::NotNullNonOwnerPtr<::LevelDbEnv> levelDbEnv,
335 ::std::function<void(::std::string const&)> displayMessageFunction
336 );
337
338 MCAPI void _clearArchiverState();
339
340 MCAPI void
341 _copyPackToTemp(::PackInstance const& packInstance, ::Core::Path const& tempPath, ::FileArchiver::Result& result);
342
343 MCAPI ::std::shared_ptr<::Bedrock::Threading::IAsyncResult<::FileArchiver::Result>> _enqueueExportWorldTasks(
344 ::Core::Path const& outputFilePath,
345 ::std::string const& worldId,
346 bool exportType,
347 ::FileArchiver::ExportType showToast,
348 ::FileArchiver::ShowToast preTaskHandle,
349 ::std::shared_ptr<::Bedrock::Threading::IAsyncResult<void>> cleanupTask,
350 ::std::function<void(::FileArchiver::Result&)> convertPreExportCallback,
351 ::std::function<void(::LevelData&)> isBundle
352 );
353
354 MCAPI void _exportLevelFiles(
355 ::Core::Path const& outputFilePath,
356 bool isBundle,
357 ::std::shared_ptr<::FileArchiver::ExportData> exportData
358 );
359
360 MCAPI void _printLevelResultMessage(::FileArchiver::Result const& result);
361
362 MCAPI void _printLevelStartMessage();
363
364 MCAPI ::FileArchiverOutcome _processWorldForTemplate(::std::shared_ptr<::FileArchiver::ExportData> const& exportData
365 );
366
367 MCAPI void _revertPremiumUpgradePacks(::Core::Path const& filePath);
368
369 MCAPI ::FileArchiver::Result _tryBeginExportLevel(
370 ::std::string const& levelId,
371 ::Core::Path const& exportFilePath,
372 ::FileArchiver::ShowToast showToast
373 );
374
375 MCAPI bool _validatePremiumUpgradePacks(::Core::Path const& filePath);
376
377 MCAPI ::std::string copyLevel(::std::string const& worldId);
378
379 MCAPI ::std::shared_ptr<::Bedrock::Threading::IAsyncResult<::FileArchiver::Result>> exportCurrentEditorLevel(
380 ::Level* level,
381 ::Core::Path const& preExportConvertedCallback,
382 ::std::function<void(::LevelData&)> exportType,
383 ::FileArchiver::ExportType exportFilePath,
384 ::FileArchiver::ShowToast toast
385 );
386
387 MCAPI ::std::shared_ptr<::Bedrock::Threading::IAsyncResult<::FileArchiver::Result>> exportCurrentLevel(
388 ::Level* level,
389 bool exportType,
390 ::FileArchiver::ExportType exportFilePath,
391 ::Core::Path const& isBundle
392 );
393
394 MCAPI void exportCurrentLevel(
395 ::Level* level,
396 bool exportType,
397 ::FileArchiver::ExportType exportFilePath,
398 ::Core::Path const& exportCallback,
399 ::std::function<void(::FileArchiver::Result&)> isBundle
400 );
401
402 MCAPI ::std::shared_ptr<::Bedrock::Threading::IAsyncResult<::FileArchiver::Result>>
403 exportPack(::Core::Path const& path, ::Core::Path const& exportFilePath);
404
405 MCAPI void exportPack(
406 ::Core::Path const& path,
407 ::Core::Path const& exportFilePath,
408 ::std::function<void(::FileArchiver::Result&)> exportCallback
409 );
410
411 MCAPI ::FileArchiver::State getCurrentState();
412
413 MCAPI ::Bedrock::NotNullNonOwnerPtr<::FileArchiver::ProgressReporter> getProgressReporter();
414
415 MCAPI void setWorldConverter(::std::unique_ptr<::FileArchiver::IWorldConverter> worldConverter);
416 // NOLINTEND
417
418public:
419 // static variables
420 // NOLINTBEGIN
421 MCAPI static ::std::string const& EXTENSION_ADDON();
422
423 MCAPI static ::std::string const& EXTENSION_EDITOR_ADDON();
424
425 MCAPI static ::std::string const& EXTENSION_PROJECT();
426
427 MCAPI static ::std::string const& EXTENSION_RESOURCEPACK();
428
429 MCAPI static ::std::string const& EXTENSION_TEMPLATE();
430
431 MCAPI static ::std::string const& EXTENSION_VANILLA();
432
433 MCAPI static ::std::string const& IMPORT_LOCK_FILE();
434 // NOLINTEND
435
436public:
437 // constructor thunks
438 // NOLINTBEGIN
439 MCAPI void* $ctor(
440 ::Scheduler& scheduler,
441 ::ILevelListCache& levelListCache,
442 ::Bedrock::NotNullNonOwnerPtr<::Core::FilePathManager> const& pathManager,
443 ::Bedrock::NotNullNonOwnerPtr<::IResourcePackRepository> const& resourcePackRepository,
444 bool isEditorModeEnabled,
445 ::std::unique_ptr<::FileArchiver::IWorldConverter> worldConverter,
446 ::Bedrock::NotNullNonOwnerPtr<::IContentKeyProvider const> keyProvider,
447 ::Bedrock::NotNullNonOwnerPtr<::LevelDbEnv> levelDbEnv,
448 ::std::function<void(::std::string const&)> displayMessageFunction
449 );
450 // NOLINTEND
451
452public:
453 // destructor thunk
454 // NOLINTBEGIN
455 MCAPI void $dtor();
456 // NOLINTEND
457
458public:
459 // virtual function thunks
460 // NOLINTBEGIN
461 MCAPI ::std::shared_ptr<::FilePickerSettings> $generateFilePickerSettings(
462 ::std::vector<::FileArchiver::ExportType> const& types,
463 ::std::string const& worldId
464 ) const;
465 // NOLINTEND
466
467public:
468 // vftables
469 // NOLINTBEGIN
470 MCAPI static void** $vftable();
471 // NOLINTEND
472};
Definition EnableNonOwnerReferences.h:7
Definition IAsyncResult.h:8
Definition Path.h:15
Definition ZipProgress.h:7
Definition FileArchiver.h:186
Definition FileArchiver.h:134
Definition FileArchiver.h:27
Definition FilePickerSettings.h:5
Definition IContentKeyProvider.h:13
Definition ILevelListCache.h:27
Definition IResourcePackRepository.h:33
Definition LevelData.h:48
Definition LevelDbEnv.h:8
Definition Level.h:234
Definition PackInstance.h:23
Definition Path.h:16
Definition Scheduler.h:13
Definition FileArchiver.h:118
Definition FileArchiver.h:255
Definition FileArchiver.h:89
Definition FileArchiver.h:218
Definition FileArchiver.h:60
Definition Alias.h:14