LeviLamina
Loading...
Searching...
No Matches
ResourcePackFileUploadManager.h
1#pragma once
2
3#include "mc/_HeaderOutputPredefine.h"
4
5// auto generated inclusion list
6#include "mc/deps/core/file/PathBuffer.h"
7#include "mc/deps/core/resource/PackType.h"
8#include "mc/deps/core/threading/Async.h"
9#include "mc/deps/core/threading/SharedAsync.h"
10#include "mc/deps/core/utility/NonOwnerPointer.h"
11#include "mc/util/FileUploadManager.h"
12
13// auto generated forward declare list
14// clang-format off
15class AppPlatform;
16class FileArchiver;
19class TaskGroup;
20namespace Core { class Path; }
21namespace Core { class PathView; }
22namespace Core::ZipUtils { class IZipUtility; }
23namespace Json { class Value; }
24namespace ResourcePackPathLifetimeHelpers { class ResourcePackPathCache; }
25namespace ResourcePackPathLifetimeHelpers { class ScopeDestroyedPath; }
26// clang-format on
27
28class ResourcePackFileUploadManager : public ::FileUploadManager {
29public:
30 // member variables
31 // NOLINTBEGIN
32 ::ll::TypedStorage<8, 24, ::Bedrock::NotNullNonOwnerPtr<::AppPlatform>> mAppPlatform;
33 ::ll::TypedStorage<
34 8,
35 24,
36 ::std::vector<::std::shared_ptr<::ResourcePackPathLifetimeHelpers::ScopeDestroyedPath const>>>
37 mZipPaths;
38 ::ll::TypedStorage<8, 8, ::ResourcePackPathLifetimeHelpers::ResourcePackPathCache&> mResourcePackPathCache;
39 ::ll::TypedStorage<8, 16, ::gsl::not_null<::std::shared_ptr<::Bedrock::Threading::SharedAsync<void>>>>
40 mPreviousUpload;
41 ::ll::TypedStorage<8, 8, ::gsl::not_null<::std::unique_ptr<::Core::ZipUtils::IZipUtility>>> mZipUtility;
42 // NOLINTEND
43
44public:
45 // prevent constructor by default
46 ResourcePackFileUploadManager& operator=(ResourcePackFileUploadManager const&);
47 ResourcePackFileUploadManager(ResourcePackFileUploadManager const&);
48 ResourcePackFileUploadManager();
49
50public:
51 // virtual functions
52 // NOLINTBEGIN
53 virtual void archiveAndUploadFileToRealmStorage(
54 ::std::string const& uploadId,
55 ::Core::Path const& path,
56 int const slotIndex,
57 ::std::string const& realmsGuid
58 ) /*override*/;
59
60 virtual void
61 uploadFileToRealmStorage(::std::string const& uploadId, ::Core::Path const& path, int const slotIndex) /*override*/;
62 // NOLINTEND
63
64public:
65 // member functions
66 // NOLINTBEGIN
67 MCAPI ResourcePackFileUploadManager(
68 ::Bedrock::NotNullNonOwnerPtr<::AppPlatform> appPlatform,
69 ::TaskGroup& taskGroup,
70 ::std::shared_ptr<::IFileChunkUploader> fileUploader,
71 ::std::unique_ptr<::Core::ZipUtils::IZipUtility>&& zipUtility,
72 ::std::shared_ptr<::Bedrock::Threading::SharedAsync<void>> previousUpload,
74 );
75
76#ifdef LL_PLAT_C
77 MCAPI ResourcePackFileUploadManager(
78 ::Bedrock::NotNullNonOwnerPtr<::AppPlatform> appPlatform,
79 ::TaskGroup& taskGroup,
80 ::std::shared_ptr<::IFileChunkUploader> fileUploader,
81 ::Bedrock::NotNullNonOwnerPtr<::FileArchiver> const& FileArchiver,
82 ::std::unique_ptr<::Core::ZipUtils::IZipUtility>&& zipUtility,
83 ::std::shared_ptr<::Bedrock::Threading::SharedAsync<void>> previousUpload,
85 );
86#endif
87
88 MCAPI void _addZipPath(::Core::PathBuffer<::std::string> const& resourceZipPath);
89
90 MCAPI void _archiveAndUploadPackToRealmStorage(
91 ::std::string const& uploadId,
92 ::Core::Path const& path,
93 int slotIndex,
94 ::std::string const&
95 );
96
97 MCAPI ::Bedrock::Threading::Async<void> _extractPackFromZipAndUpload(
98 ::std::string const& resourcePack,
99 ::ResourceLocation const& resourcePackLocation,
100 ::Core::PathBuffer<::std::string> const& relativePathWithinZip,
101 ::Core::PathBuffer<::std::string> const& resourceZipPath,
102 ::Json::Value const& uploadOptions
103 );
104
105 MCAPI bool _unzipEmbeddedResourcePackForUpload(
106 ::ResourceLocation const& resourcePackLocation,
107 ::Core::PathBuffer<::std::string> const& relativePathWithinZip,
108 ::Core::PathView outputPath
109 );
110
111 MCAPI ::Bedrock::Threading::Async<void> _uploadResourcePackFolder(
112 ::std::string const& resourcePack,
113 ::ResourceLocation const& resourcePackLocation,
114 ::Core::PathBuffer<::std::string> const& resourceZipPath,
115 ::Json::Value const& uploadOptions
116 );
117
118 MCAPI bool _zipResourcePackForUpload(
119 ::ResourceLocation const& resourcePackLocation,
120 ::Core::PathBuffer<::std::string> const& resourceZipPath
121 );
122
123 MCAPI ::Bedrock::Threading::Async<void> uploadResourcePack(
124 ::std::string const& resourcePackName,
125 ::ResourceLocation const& resourceLocation,
126 bool isZipped,
127 ::Core::PathBuffer<::std::string> const& relativePathWithinZip,
128 bool isPremium,
129 ::PackType packType
130 );
131 // NOLINTEND
132
133public:
134 // constructor thunks
135 // NOLINTBEGIN
136 MCAPI void* $ctor(
137 ::Bedrock::NotNullNonOwnerPtr<::AppPlatform> appPlatform,
138 ::TaskGroup& taskGroup,
139 ::std::shared_ptr<::IFileChunkUploader> fileUploader,
140 ::std::unique_ptr<::Core::ZipUtils::IZipUtility>&& zipUtility,
141 ::std::shared_ptr<::Bedrock::Threading::SharedAsync<void>> previousUpload,
143 );
144
145#ifdef LL_PLAT_C
146 MCAPI void* $ctor(
147 ::Bedrock::NotNullNonOwnerPtr<::AppPlatform> appPlatform,
148 ::TaskGroup& taskGroup,
149 ::std::shared_ptr<::IFileChunkUploader> fileUploader,
150 ::Bedrock::NotNullNonOwnerPtr<::FileArchiver> const& FileArchiver,
151 ::std::unique_ptr<::Core::ZipUtils::IZipUtility>&& zipUtility,
152 ::std::shared_ptr<::Bedrock::Threading::SharedAsync<void>> previousUpload,
154 );
155#endif
156 // NOLINTEND
157
158public:
159 // virtual function thunks
160 // NOLINTBEGIN
161 MCAPI void $archiveAndUploadFileToRealmStorage(
162 ::std::string const& uploadId,
163 ::Core::Path const& path,
164 int const slotIndex,
165 ::std::string const& realmsGuid
166 );
167
168 MCAPI void $uploadFileToRealmStorage(::std::string const& uploadId, ::Core::Path const& path, int const slotIndex);
169
170
171 // NOLINTEND
172
173public:
174 // vftables
175 // NOLINTBEGIN
176 MCNAPI static void** $vftable();
177 // NOLINTEND
178};
Definition AppPlatform.h:91
Definition SharedAsync.h:8
Definition PathBuffer.h:8
Definition PathView.h:19
Definition Path.h:12
Definition IZipUtility.h:21
Definition FileArchiver.h:36
Definition IFileChunkUploader.h:15
Definition Value.h:16
Definition ResourceLocation.h:15
static MCAPI void ** $vftable()
Definition ResourcePackPathCache.h:15
Definition ScopeDestroyedPath.h:16
Definition TaskGroup.h:55