LeviLamina
Loading...
Searching...
No Matches
ZipPackAccessStrategy.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/utility/NonOwnerPointer.h"
8#include "mc/platform/Result.h"
9#include "mc/resources/PackAccessStrategy.h"
10#include "mc/resources/PackAccessStrategyType.h"
11
12// auto generated forward declare list
13// clang-format off
14class ContentIdentity;
15class IFileAccess;
18struct ZipPackArgs;
19namespace Bedrock::Resources { class PreloadedPathHandle; }
20namespace Bedrock::Resources::Archive { class Reader; }
21namespace Core { class Path; }
22namespace Core { class PathView; }
23namespace Core { class UnzipFile; }
24// clang-format on
25
26class ZipPackAccessStrategy : public ::PackAccessStrategy {
27public:
28 // ZipPackAccessStrategy inner types declare
29 // clang-format off
30 class ZipFileAccess;
31 // clang-format on
32
33 // ZipPackAccessStrategy inner types define
34 class ZipFileAccess {
35 public:
36 // member variables
37 // NOLINTBEGIN
40 // NOLINTEND
41
42 public:
43 // prevent constructor by default
44 ZipFileAccess& operator=(ZipFileAccess const&);
45 ZipFileAccess(ZipFileAccess const&);
46 ZipFileAccess();
47
48 public:
49 // member functions
50 // NOLINTBEGIN
51 MCNAPI ::std::shared_ptr<::Core::UnzipFile>
52 get(::ResourceLocation const& archiveLocation, ::gsl::not_null<::IFileAccess*> fileAccess);
53
55 // NOLINTEND
56
57 public:
58 // destructor thunk
59 // NOLINTBEGIN
60 MCNAPI void $dtor();
61 // NOLINTEND
62 };
63
64public:
65 // member variables
66 // NOLINTBEGIN
75 // NOLINTEND
76
77public:
78 // prevent constructor by default
79 ZipPackAccessStrategy& operator=(ZipPackAccessStrategy const&);
80 ZipPackAccessStrategy(ZipPackAccessStrategy const&);
81 ZipPackAccessStrategy();
82
83public:
84 // virtual functions
85 // NOLINTBEGIN
86 virtual ~ZipPackAccessStrategy() /*override*/;
87
88 virtual uint64 getPackSize() const /*override*/;
89
90 virtual ::ResourceLocation const& getPackLocation() const /*override*/;
91
92 virtual ::std::string const& getPackName() const /*override*/;
93
94 virtual bool isWritable() const /*override*/;
95
96 virtual bool isTrusted() const /*override*/;
97
98 virtual bool hasAsset(::Core::Path const& packRelativePath, bool trustedContentOnly, bool caseSensative) const
99 /*override*/;
100
101 virtual bool hasFolder(::Core::Path const& packRelativePath) const /*override*/;
102
103 virtual bool getAsset(::Core::Path const& packRelativePath, ::std::string& result, bool trustedContentOnly) const
104 /*override*/;
105
106 virtual void
107 forEachIn(::Core::Path const& packRelativePath, ::std::function<void(::Core::Path const&)> callback, bool) const
108 /*override*/;
109
110 virtual ::PackAccessStrategyType getStrategyType() const /*override*/;
111
112 virtual ::Core::PathBuffer<::std::string> const& getSubPath() const /*override*/;
113
114 virtual bool supportsSignatureVerification() const /*override*/;
115
116 virtual ::std::unique_ptr<::PackAccessStrategy> createSubPack(::Core::Path const& subPath) const /*override*/;
117
118 virtual void unload() /*override*/;
119
120 virtual ::ContentIdentity readContentIdentity() const /*override*/;
121
122 virtual ::Bedrock::Result<::StreamableAssetSource>
123 getStreamableSource(::Core::Path const& packRelativePath, ::std::optional<::Core::PathView> tempDirectory) const
124 /*override*/;
125
126 virtual ::std::unique_ptr<::Bedrock::Resources::Archive::Reader>
127 _loadArchive(::Core::Path const& packRelativePath) const /*override*/;
128
129 virtual ::std::vector<::Bedrock::Resources::PreloadedPathHandle>
130 _preloadSubFolders(::Core::Path const& packRelativePath) const /*override*/;
131 // NOLINTEND
132
133public:
134 // member functions
135 // NOLINTBEGIN
136 MCNAPI ZipPackAccessStrategy(::gsl::not_null<::std::shared_ptr<::IFileAccess>> fileAccess, ::ZipPackArgs&& args);
137
138 MCNAPI ZipPackAccessStrategy(
139 ::std::variant<::Bedrock::NotNullNonOwnerPtr<::IFileAccess>, ::gsl::not_null<::std::shared_ptr<::IFileAccess>>>
140 fileAccess,
141 ::ZipPackArgs&& args
142 );
143
144 MCNAPI bool _getAsset(
145 ::gsl::not_null<::Core::UnzipFile*> zipFile,
146 ::Core::Path const& packRelativePath,
147 ::std::string& result
148 ) const;
149
150 MCNAPI ::std::shared_ptr<::Core::UnzipFile> initZipFile() const;
151 // NOLINTEND
152
153public:
154 // constructor thunks
155 // NOLINTBEGIN
156 MCNAPI void* $ctor(::gsl::not_null<::std::shared_ptr<::IFileAccess>> fileAccess, ::ZipPackArgs&& args);
157
158 MCNAPI void* $ctor(
159 ::std::variant<::Bedrock::NotNullNonOwnerPtr<::IFileAccess>, ::gsl::not_null<::std::shared_ptr<::IFileAccess>>>
160 fileAccess,
161 ::ZipPackArgs&& args
162 );
163 // NOLINTEND
164
165public:
166 // destructor thunk
167 // NOLINTBEGIN
168 MCNAPI void $dtor();
169 // NOLINTEND
170
171public:
172 // virtual function thunks
173 // NOLINTBEGIN
174 MCNAPI uint64 $getPackSize() const;
175
176 MCNAPI ::ResourceLocation const& $getPackLocation() const;
177
178 MCNAPI ::std::string const& $getPackName() const;
179
180 MCNAPI bool $isWritable() const;
181
182 MCNAPI bool $isTrusted() const;
183
184 MCNAPI bool $hasAsset(::Core::Path const& packRelativePath, bool trustedContentOnly, bool caseSensative) const;
185
186 MCNAPI bool $hasFolder(::Core::Path const& packRelativePath) const;
187
188 MCNAPI bool $getAsset(::Core::Path const& packRelativePath, ::std::string& result, bool trustedContentOnly) const;
189
190 MCNAPI void
191 $forEachIn(::Core::Path const& packRelativePath, ::std::function<void(::Core::Path const&)> callback, bool) const;
192
193 MCNAPI ::PackAccessStrategyType $getStrategyType() const;
194
195 MCNAPI ::Core::PathBuffer<::std::string> const& $getSubPath() const;
196
198
199 MCNAPI ::std::unique_ptr<::PackAccessStrategy> $createSubPack(::Core::Path const& subPath) const;
200
201 MCNAPI void $unload();
202
204
205 MCNAPI ::Bedrock::Result<::StreamableAssetSource>
206 $getStreamableSource(::Core::Path const& packRelativePath, ::std::optional<::Core::PathView> tempDirectory) const;
207
208 MCNAPI ::std::unique_ptr<::Bedrock::Resources::Archive::Reader>
209 $_loadArchive(::Core::Path const& packRelativePath) const;
210
211 MCNAPI ::std::vector<::Bedrock::Resources::PreloadedPathHandle>
212 $_preloadSubFolders(::Core::Path const& packRelativePath) const;
213
214
215 // NOLINTEND
216
217public:
218 // vftables
219 // NOLINTBEGIN
220 MCNAPI static void** $vftable();
221 // NOLINTEND
222};
Definition PreloadedPathHandle.h:16
Definition ContentIdentity.h:8
Definition PathView.h:19
Definition Path.h:12
Definition UnzipFile.h:18
Definition IFileAccess.h:15
Definition Path.h:16
Definition ResourceLocation.h:15
Definition ZipPackAccessStrategy.h:34
MCAPI ::std::shared_ptr<::Core::UnzipFile > get(::ResourceLocation const &archiveLocation, ::gsl::not_null<::IFileAccess * > fileAccess)
MCAPI bool _getAsset(::gsl::not_null<::Core::UnzipFile * > zipFile, ::Core::Path const &packRelativePath, ::std::string &result) const
MCAPI bool $isTrusted() const
MCAPI ::std::unique_ptr<::Bedrock::Resources::Archive::Reader > $_loadArchive(::Core::Path const &packRelativePath) const
MCAPI bool $isWritable() const
MCAPI uint64 $getPackSize() const
MCAPI void * $ctor(::gsl::not_null<::std::shared_ptr<::IFileAccess > > fileAccess, ::ZipPackArgs &&args)
MCAPI bool $supportsSignatureVerification() const
static MCAPI void ** $vftable()
MCAPI ::std::shared_ptr<::Core::UnzipFile > initZipFile() const
MCAPI::std::string const & $getPackName() const
MCAPI ::std::unique_ptr<::PackAccessStrategy > $createSubPack(::Core::Path const &subPath) const
MCAPI void $forEachIn(::Core::Path const &packRelativePath, ::std::function< void(::Core::Path const &)> callback, bool) const
MCAPI ::Core::PathBuffer<::std::string > const & $getSubPath() const
MCAPI bool $hasFolder(::Core::Path const &packRelativePath) const
MCAPI void $unload()
MCAPI::PackAccessStrategyType $getStrategyType() const
MCAPI ::std::vector<::Bedrock::Resources::PreloadedPathHandle > $_preloadSubFolders(::Core::Path const &packRelativePath) const
MCAPI bool $hasAsset(::Core::Path const &packRelativePath, bool trustedContentOnly, bool caseSensative) const
MCAPI::ResourceLocation const & $getPackLocation() const
MCAPI::ContentIdentity $readContentIdentity() const
MCAPI ::Bedrock::Result<::StreamableAssetSource > $getStreamableSource(::Core::Path const &packRelativePath, ::std::optional<::Core::PathView > tempDirectory) const
MCAPI bool $getAsset(::Core::Path const &packRelativePath, ::std::string &result, bool trustedContentOnly) const
STL namespace.
Definition StreamableAssetSource.h:5
Definition ZipPackArgs.h:5
Definition Alias.h:14