Skip to content
LeviMC
English
AutoLightDark
LeviLamina
Loading...
Searching...
No Matches
PreloadCache.h
1#pragma once
2
3#include "mc/_HeaderOutputPredefine.h"
4
5// auto generated inclusion list
6#include "mc/deps/resource_processing/PreloadState.h"
7#include "mc/platform/brstd/flat_set.h"
8
9// auto generated forward declare list
10// clang-format off
11namespace Bedrock::Resources { class PreloadedPathHandle; }
12namespace Bedrock::Resources::Archive { class Reader; }
13namespace Bedrock::Resources::Archive { class TOCReader; }
14namespace Core { class Path; }
15namespace Core { class PathView; }
16namespace Core { struct PathLessTransparent; }
17// clang-format on
18
19namespace Bedrock::Resources {
20
21class PreloadCache : public ::std::enable_shared_from_this<::Bedrock::Resources::PreloadCache> {
22public:
23 // PreloadCache inner types declare
24 // clang-format off
25 struct InFlightTocBuild;
26 struct InFlightTocBuilds;
29 // clang-format on
30
31 // PreloadCache inner types define
32 struct InFlightTocBuild {
33 public:
34 // member variables
35 // NOLINTBEGIN
40 // NOLINTEND
41
42 public:
43 // prevent constructor by default
44 InFlightTocBuild& operator=(InFlightTocBuild const&);
45 InFlightTocBuild(InFlightTocBuild const&);
46 InFlightTocBuild();
47 };
48
49 struct InFlightTocBuilds {
50 public:
51 // member variables
52 // NOLINTBEGIN
55 // NOLINTEND
56
57 public:
58 // prevent constructor by default
59 InFlightTocBuilds& operator=(InFlightTocBuilds const&);
60 InFlightTocBuilds(InFlightTocBuilds const&);
61 InFlightTocBuilds();
62 };
63
64 struct PreloadedContentMaps {
65 public:
66 // member variables
67 // NOLINTBEGIN
70 // NOLINTEND
71
72 public:
73 // prevent constructor by default
74 PreloadedContentMaps& operator=(PreloadedContentMaps const&);
75 PreloadedContentMaps(PreloadedContentMaps const&);
76 PreloadedContentMaps();
77 };
78
80
81public:
82 // member variables
83 // NOLINTBEGIN
90 // NOLINTEND
91
92public:
93 // prevent constructor by default
94 PreloadCache& operator=(PreloadCache const&);
95 PreloadCache(PreloadCache const&);
96 PreloadCache();
97
98public:
99 // member functions
100 // NOLINTBEGIN
101 MCNAPI ::std::shared_ptr<::Bedrock::Resources::Archive::TOCReader>
102 _cacheTOCReaderSingleFlight(::Core::Path const& archivePath) const;
103
104 MCNAPI ::Bedrock::Resources::PreloadedPathHandle _findPreloadedPath(
106 ::Core::Path const& cleanPath
107 ) const;
108
109 MCNAPI ::Bedrock::Resources::PreloadState _getAsset(
111 ::Core::PathView const& path,
112 ::std::string* assetData
113 ) const;
114
115 MCNAPI ::Bedrock::Resources::PreloadedPathHandle
116 addPreloadedPath(::Core::Path const& path, ::std::unique_ptr<::Bedrock::Resources::Archive::Reader> archiveReader);
117
118 MCNAPI ::Bedrock::Resources::PreloadedPathHandle findPreloadedPath(::Core::Path const& path) const;
119
120 MCNAPI ::Bedrock::Resources::PreloadState
121 getAsset(::Core::PathView const& path, ::Core::PathView const& archivePath, ::std::string& contents) const;
122
123 MCNAPI ::Bedrock::Resources::PreloadState
124 hasAssetFallback(::Core::Path const& path, ::Core::Path const& archivePath) const;
125
126#ifdef LL_PLAT_C
127 MCNAPI void invalidate();
128#endif
129 // NOLINTEND
130
131public:
132 // static functions
133 // NOLINTBEGIN
134 MCNAPI static void _preloadedPathDeleter(
135 ::std::weak_ptr<::Bedrock::Resources::PreloadCache> weakThis,
136 ::Core::Path const& path,
138 );
139 // NOLINTEND
140};
141
142} // namespace Bedrock::Resources
MCAPI::Bedrock::Resources::PreloadedPathHandle _findPreloadedPath(::Bedrock::Resources::PreloadCache::PreloadedContentMaps const &contentMaps, ::Core::Path const &cleanPath) const
MCAPI::Bedrock::Resources::PreloadState hasAssetFallback(::Core::Path const &path, ::Core::Path const &archivePath) const
static MCAPI void _preloadedPathDeleter(::std::weak_ptr<::Bedrock::Resources::PreloadCache > weakThis, ::Core::Path const &path, ::Bedrock::Resources::Archive::Reader *reader)
MCAPI::Bedrock::Resources::PreloadState _getAsset(::Bedrock::Resources::PreloadCache::PreloadedContentMaps const &contentMaps, ::Core::PathView const &path, ::std::string *assetData) const
MCAPI::Bedrock::Resources::PreloadState getAsset(::Core::PathView const &path, ::Core::PathView const &archivePath, ::std::string &contents) const
MCAPI::Bedrock::Resources::PreloadedPathHandle findPreloadedPath(::Core::Path const &path) const
MCAPI::Bedrock::Resources::PreloadedPathHandle addPreloadedPath(::Core::Path const &path, ::std::unique_ptr<::Bedrock::Resources::Archive::Reader > archiveReader)
MCAPI ::std::shared_ptr<::Bedrock::Resources::Archive::TOCReader > _cacheTOCReaderSingleFlight(::Core::Path const &archivePath) const
Definition PreloadedPathHandle.h:16
Definition PathView.h:19
Definition Path.h:10
Definition PathLessTransparent.h:12
Definition Alias.h:14