Skip to content
LeviMC
English
AutoLightDark
LeviLamina
Loading...
Searching...
No Matches
BakedPackAccessStrategy.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/string/BasicStackString.h"
8#include "mc/platform/Result.h"
9#include "mc/platform/brstd/function_ref.h"
10#include "mc/resources/PackAccessAssetGenerationResult.h"
11#include "mc/resources/PackAccessStrategy.h"
12#include "mc/resources/PackAccessStrategyType.h"
13
14// auto generated forward declare list
15// clang-format off
18namespace Bedrock::Resources { class BrpakIndex; }
19namespace Bedrock::Resources { struct BrpakIndexEntry; }
20namespace Core { class FileHandlePool; }
21namespace Core { class Path; }
22namespace Core { class PathView; }
23// clang-format on
24
25class BakedPackAccessStrategy : public ::PackAccessStrategy {
26public:
27 // member variables
28 // NOLINTBEGIN
35 // NOLINTEND
36
37public:
38 // prevent constructor by default
39 BakedPackAccessStrategy& operator=(BakedPackAccessStrategy const&);
40 BakedPackAccessStrategy(BakedPackAccessStrategy const&);
41 BakedPackAccessStrategy();
42
43public:
44 // virtual functions
45 // NOLINTBEGIN
46 virtual ~BakedPackAccessStrategy() /*override*/ = default;
47
48 virtual uint64 getPackSize() const /*override*/;
49
50 virtual ::ResourceLocation const& getPackLocation() const /*override*/;
51
52 virtual ::std::string const& getPackName() const /*override*/;
53
54 virtual bool isWritable() const /*override*/;
55
56 virtual bool isTrusted() const /*override*/;
57
58 virtual bool hasAsset(::Core::PathView const& packRelativePath, bool trustedContentOnly, bool) const /*override*/;
59
60 virtual bool hasFolder(::Core::Path const& packRelativePath) const /*override*/;
61
62 virtual bool
63 getAsset(::Core::PathView const& packRelativePath, ::std::string& result, bool trustedContentOnly) const
64 /*override*/;
65
66 virtual void
67 forEachIn(::Core::Path const& packRelativePath, ::std::function<void(::Core::Path const&)> callback, bool) const
68 /*override*/;
69
70 virtual void
71 forEachInAssetSet(::Core::Path const& packRelativePath, ::std::function<void(::Core::Path const&)> callback) const
72 /*override*/;
73
74 virtual ::PackAccessStrategyType getStrategyType() const /*override*/;
75
76 virtual ::std::unique_ptr<::PackAccessStrategy> createSubPack(::Core::Path const& subPath) const /*override*/;
77
78 virtual ::PackAccessAssetGenerationResult generateAssetSet() /*override*/;
79
80 virtual void unload() /*override*/;
81
82 virtual ::Bedrock::Result<::StreamableAssetSource>
83 getStreamableSource(::Core::Path const& packRelativePath, ::std::optional<::Core::PathView> tempDirectory) const
84 /*override*/;
85 // NOLINTEND
86
87public:
88 // member functions
89 // NOLINTBEGIN
91 ::ResourceLocation const& packLocation,
92 ::Core::Path brpakPath,
93 ::std::shared_ptr<::Bedrock::Resources::BrpakIndex const> index,
94 ::gsl::not_null<::std::shared_ptr<::Core::FileHandlePool>> handlePool,
95 ::std::string subPath
96 );
97
98 MCNAPI void _forEachEntry(
99 ::brstd::function_ref<void(::std::string const&, ::Bedrock::Resources::BrpakIndexEntry const&)> callback
100 ) const;
101 // NOLINTEND
102
103public:
104 // static functions
105 // NOLINTBEGIN
106 MCNAPI static ::std::string _getParentDirectory(::std::string const& path);
107
108 MCNAPI static ::Core::PathBuffer<::Core::BasicStackString<char, 1024>>
110 // NOLINTEND
111
112public:
113 // constructor thunks
114 // NOLINTBEGIN
115 MCNAPI void* $ctor(
116 ::ResourceLocation const& packLocation,
117 ::Core::Path brpakPath,
118 ::std::shared_ptr<::Bedrock::Resources::BrpakIndex const> index,
119 ::gsl::not_null<::std::shared_ptr<::Core::FileHandlePool>> handlePool,
120 ::std::string subPath
121 );
122 // NOLINTEND
123
124public:
125 // virtual function thunks
126 // NOLINTBEGIN
127 MCNAPI uint64 $getPackSize() const;
128
129 MCNAPI ::ResourceLocation const& $getPackLocation() const;
130
131 MCNAPI ::std::string const& $getPackName() const;
132
133 MCNAPI bool $isWritable() const;
134
135 MCNAPI bool $isTrusted() const;
136
137 MCNAPI bool $hasAsset(::Core::PathView const& packRelativePath, bool trustedContentOnly, bool) const;
138
139 MCNAPI bool $hasFolder(::Core::Path const& packRelativePath) const;
140
141 MCNAPI bool
142 $getAsset(::Core::PathView const& packRelativePath, ::std::string& result, bool trustedContentOnly) const;
143
144 MCNAPI void
145 $forEachIn(::Core::Path const& packRelativePath, ::std::function<void(::Core::Path const&)> callback, bool) const;
146
147 MCNAPI void
148 $forEachInAssetSet(::Core::Path const& packRelativePath, ::std::function<void(::Core::Path const&)> callback) const;
149
150 MCNAPI ::PackAccessStrategyType $getStrategyType() const;
151
152 MCNAPI ::std::unique_ptr<::PackAccessStrategy> $createSubPack(::Core::Path const& subPath) const;
153
154 MCNAPI ::PackAccessAssetGenerationResult $generateAssetSet();
155
156 MCNAPI void $unload();
157
158 MCNAPI ::Bedrock::Result<::StreamableAssetSource>
159 $getStreamableSource(::Core::Path const& packRelativePath, ::std::optional<::Core::PathView> tempDirectory) const;
160
161
162 // NOLINTEND
163};
static MCAPI ::Core::PathBuffer<::Core::BasicStackString< char, 1024 > > _normalizeEntryPath(::Core::PathView const &path)
MCAPI::ResourceLocation const & $getPackLocation() const
MCAPI uint64 $getPackSize() const
MCAPI::PackAccessStrategyType $getStrategyType() const
MCAPI void _forEachEntry(::brstd::function_ref< void(::std::string const &, ::Bedrock::Resources::BrpakIndexEntry const &)> callback) const
MCAPI::std::string const & $getPackName() const
MCAPI bool $isWritable() const
MCAPI bool $hasAsset(::Core::PathView const &packRelativePath, bool trustedContentOnly, bool) const
MCAPI ::std::unique_ptr<::PackAccessStrategy > $createSubPack(::Core::Path const &subPath) const
MCAPI bool $getAsset(::Core::PathView const &packRelativePath, ::std::string &result, bool trustedContentOnly) const
MCAPI BakedPackAccessStrategy(::ResourceLocation const &packLocation, ::Core::Path brpakPath, ::std::shared_ptr<::Bedrock::Resources::BrpakIndex const > index, ::gsl::not_null<::std::shared_ptr<::Core::FileHandlePool > > handlePool, ::std::string subPath)
static MCAPI ::std::string _getParentDirectory(::std::string const &path)
MCAPI ::Bedrock::Result<::StreamableAssetSource > $getStreamableSource(::Core::Path const &packRelativePath, ::std::optional<::Core::PathView > tempDirectory) const
MCAPI void $forEachInAssetSet(::Core::Path const &packRelativePath, ::std::function< void(::Core::Path const &)> callback) const
MCAPI bool $hasFolder(::Core::Path const &packRelativePath) const
MCAPI bool $isTrusted() const
MCAPI void $forEachIn(::Core::Path const &packRelativePath, ::std::function< void(::Core::Path const &)> callback, bool) const
MCAPI::PackAccessAssetGenerationResult $generateAssetSet()
MCAPI void * $ctor(::ResourceLocation const &packLocation, ::Core::Path brpakPath, ::std::shared_ptr<::Bedrock::Resources::BrpakIndex const > index, ::gsl::not_null<::std::shared_ptr<::Core::FileHandlePool > > handlePool, ::std::string subPath)
Definition BrpakIndex.h:18
Definition FileHandlePool.h:14
Definition PathView.h:19
Definition Path.h:10
Definition ResourceLocation.h:15
Definition function_ref.h:60
Definition BrpakIndexEntry.h:7
Definition StreamableAssetSource.h:5
Definition Alias.h:14