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