LeviLamina
Loading...
Searching...
No Matches
EncryptedFileAccessStrategy.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/platform/Result.h"
8#include "mc/resources/DirectoryPackAccessStrategy.h"
9#include "mc/resources/PackAccessAssetGenerationResult.h"
10#include "mc/resources/PackAccessStrategyType.h"
11
12// auto generated forward declare list
13// clang-format off
14class ContentIdentity;
19namespace Bedrock::Resources::Archive { class Reader; }
20namespace Core { class InputFileStream; }
21namespace Core { class Path; }
22namespace Core { class PathView; }
23// clang-format on
24
25class EncryptedFileAccessStrategy : public ::DirectoryPackAccessStrategy {
26public:
27 // member variables
28 // NOLINTBEGIN
31 // NOLINTEND
32
33public:
34 // prevent constructor by default
35 EncryptedFileAccessStrategy& operator=(EncryptedFileAccessStrategy const&);
36 EncryptedFileAccessStrategy(EncryptedFileAccessStrategy const&);
37 EncryptedFileAccessStrategy();
38
39public:
40 // virtual functions
41 // NOLINTBEGIN
42 virtual ::PackAccessAssetGenerationResult generateAssetSet() /*override*/;
43
44 virtual bool isTrusted() const /*override*/;
45
46 virtual bool isWritable() const /*override*/;
47
48 virtual bool hasAsset(::Core::Path const& packRelativePath, bool trustedContentOnly, bool caseSensative) const
49 /*override*/;
50
51 virtual bool getAsset(::Core::Path const& packRelativePath, ::std::string& result, bool trustedContentOnly) const
52 /*override*/;
53
54 virtual ::std::unique_ptr<::PackAccessStrategy> createSubPack(::Core::Path const& subPath) const /*override*/;
55
56 virtual bool isAssetExtractionViable() const /*override*/;
57
58 virtual ::Bedrock::Result<::StreamableAssetSource>
59 getStreamableSource(::Core::Path const&, ::std::optional<::Core::PathView>) const /*override*/;
60
61 virtual ::PackAccessStrategyType getStrategyType() const /*override*/;
62
63 virtual ::ContentIdentity readContentIdentity() const /*override*/;
64
65 virtual ::std::string _getContentsFile();
66
67 virtual ::std::string _getEncryptedAssetStream(::Core::Path const& packRelativePath) const;
68
69 virtual ::std::unique_ptr<::Bedrock::Resources::Archive::Reader>
70 _loadArchive(::Core::Path const& packRelativePath) const /*override*/;
71 // NOLINTEND
72
73public:
74 // member functions
75 // NOLINTBEGIN
77 ::ResourceLocation const& resourceLocation,
78 ::ContentIdentity const& contentIdentity,
79 ::Bedrock::NotNullNonOwnerPtr<::IContentKeyProvider const> const& keyProvider,
80 bool canRecurse,
81 ::std::optional<::std::unordered_map<::Core::Path, ::std::string>> assetSet
82 );
83
84 MCNAPI ::Bedrock::NotNullNonOwnerPtr<::IContentKeyProvider const> _getKeyProvider() const;
85
86 MCNAPI ::std::unique_ptr<::Bedrock::Resources::Archive::Reader>
87 _loadArchive(::Core::PathView packRelativeArchiveFile, ::std::string const& key) const;
88 // NOLINTEND
89
90public:
91 // static functions
92 // NOLINTBEGIN
93 MCNAPI static bool
95
96 MCNAPI static bool
97 _getContentIdentityFromEncryptedStream(::std::string& stream, ::ContentIdentity& contentIdentity);
98
99 MCNAPI static void
100 _transformStream(::std::string& stream, ::std::string const& key, ::ContentIdentity const& offset, uint64);
101
102#ifdef LL_PLAT_C
103 MCNAPI static bool contentFileExists(::Core::Path const& pathToPack);
104#endif
105
106 MCNAPI static bool isValidEncryptedPack(::Core::Path const& pathToPack, ::ContentIdentity& contentIdentity);
107 // NOLINTEND
108
109public:
110 // constructor thunks
111 // NOLINTBEGIN
112 MCNAPI void* $ctor(
113 ::ResourceLocation const& resourceLocation,
114 ::ContentIdentity const& contentIdentity,
115 ::Bedrock::NotNullNonOwnerPtr<::IContentKeyProvider const> const& keyProvider,
116 bool canRecurse,
117 ::std::optional<::std::unordered_map<::Core::Path, ::std::string>> assetSet
118 );
119 // NOLINTEND
120
121public:
122 // virtual function thunks
123 // NOLINTBEGIN
124 MCNAPI ::PackAccessAssetGenerationResult $generateAssetSet();
125
126 MCNAPI bool $isTrusted() const;
127
128 MCNAPI bool $isWritable() const;
129
130 MCNAPI bool $hasAsset(::Core::Path const& packRelativePath, bool trustedContentOnly, bool caseSensative) const;
131
132 MCNAPI bool $getAsset(::Core::Path const& packRelativePath, ::std::string& result, bool trustedContentOnly) const;
133
134 MCNAPI ::std::unique_ptr<::PackAccessStrategy> $createSubPack(::Core::Path const& subPath) const;
135
136 MCNAPI bool $isAssetExtractionViable() const;
137
138 MCNAPI ::Bedrock::Result<::StreamableAssetSource>
139 $getStreamableSource(::Core::Path const&, ::std::optional<::Core::PathView>) const;
140
141 MCNAPI ::PackAccessStrategyType $getStrategyType() const;
142
143 MCNAPI ::ContentIdentity $readContentIdentity() const;
144
145 MCNAPI ::std::string $_getContentsFile();
146
147 MCNAPI ::std::string $_getEncryptedAssetStream(::Core::Path const& packRelativePath) const;
148
149 MCNAPI ::std::unique_ptr<::Bedrock::Resources::Archive::Reader>
150 $_loadArchive(::Core::Path const& packRelativePath) const;
151
152
153 // NOLINTEND
154
155public:
156 // vftables
157 // NOLINTBEGIN
158 MCNAPI static void** $vftable();
159 // NOLINTEND
160};
Definition ContentIdentity.h:8
Definition InputFileStream.h:10
Definition PathView.h:19
Definition Path.h:12
MCAPI bool $isWritable() const
MCAPI ::Bedrock::NotNullNonOwnerPtr<::IContentKeyProvider const > _getKeyProvider() const
static MCAPI bool _getContentIdentityFromEncryptedStream(::Core::InputFileStream &stream, ::ContentIdentity &contentIdentity)
MCAPI bool $isAssetExtractionViable() const
MCAPI::std::string $_getContentsFile()
MCAPI bool $isTrusted() const
MCAPI::ContentIdentity $readContentIdentity() const
static MCAPI bool isValidEncryptedPack(::Core::Path const &pathToPack, ::ContentIdentity &contentIdentity)
MCAPI bool $hasAsset(::Core::Path const &packRelativePath, bool trustedContentOnly, bool caseSensative) const
static MCAPI bool _getContentIdentityFromEncryptedStream(::std::string &stream, ::ContentIdentity &contentIdentity)
MCAPI EncryptedFileAccessStrategy(::ResourceLocation const &resourceLocation, ::ContentIdentity const &contentIdentity, ::Bedrock::NotNullNonOwnerPtr<::IContentKeyProvider const > const &keyProvider, bool canRecurse, ::std::optional<::std::unordered_map<::Core::Path, ::std::string > > assetSet)
MCAPI::std::string $_getEncryptedAssetStream(::Core::Path const &packRelativePath) const
MCAPI ::std::unique_ptr<::Bedrock::Resources::Archive::Reader > $_loadArchive(::Core::Path const &packRelativePath) const
MCAPI ::std::unique_ptr<::PackAccessStrategy > $createSubPack(::Core::Path const &subPath) const
static MCAPI void ** $vftable()
MCAPI::PackAccessStrategyType $getStrategyType() const
MCAPI void * $ctor(::ResourceLocation const &resourceLocation, ::ContentIdentity const &contentIdentity, ::Bedrock::NotNullNonOwnerPtr<::IContentKeyProvider const > const &keyProvider, bool canRecurse, ::std::optional<::std::unordered_map<::Core::Path, ::std::string > > assetSet)
static MCAPI void _transformStream(::std::string &stream, ::std::string const &key, ::ContentIdentity const &offset, uint64)
MCAPI::PackAccessAssetGenerationResult $generateAssetSet()
MCAPI ::std::unique_ptr<::Bedrock::Resources::Archive::Reader > _loadArchive(::Core::PathView packRelativeArchiveFile, ::std::string const &key) const
MCAPI ::Bedrock::Result<::StreamableAssetSource > $getStreamableSource(::Core::Path const &, ::std::optional<::Core::PathView >) const
MCAPI bool $getAsset(::Core::Path const &packRelativePath, ::std::string &result, bool trustedContentOnly) const
Definition IContentKeyProvider.h:13
Definition PackAccessStrategy.h:26
Definition ResourceLocation.h:15
Definition StreamableAssetSource.h:5
Definition Alias.h:14