LeviLamina
Loading...
Searching...
No Matches
ResourceLoader.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/EnableNonOwnerReferences.h"
8
9// auto generated forward declare list
10// clang-format off
14namespace mce { struct Image; }
15// clang-format on
16
17class ResourceLoader : public ::Bedrock::EnableNonOwnerReferences {
18public:
19 // ResourceLoader inner types define
20 using ResourceFileExtensionSetType = ::gsl::span<::std::string const>;
21
22public:
23 // member variables
24 // NOLINTBEGIN
25 ::ll::TypedStorage<8, 64, ::std::function<::Core::PathBuffer<::std::string>()>> mGetPath;
26 // NOLINTEND
27
28public:
29 // prevent constructor by default
30 ResourceLoader();
31
32public:
33 // virtual functions
34 // NOLINTBEGIN
35 virtual ~ResourceLoader() /*override*/ = default;
36
37 virtual bool load(::ResourceLocation const& resourceLocation, ::std::string& resourceStream) const = 0;
38
39 virtual bool load(
40 ::ResourceLocation const& resourceLocation,
41 ::std::string& resourceStream,
42 ::gsl::span<::std::string const> extensionList
43 ) const = 0;
44
45 virtual bool load(
46 ::ResourceLocationPair const& resourceLocationPair,
47 ::std::string& resourceStream,
48 ::gsl::span<::std::string const> extensionList
49 ) const;
50
51 virtual bool loadText(::ResourceLocation const& resourceLocation, ::std::string& resourceStream) const;
52
53 virtual ::std::vector<::LoadedResourceData> loadAllVersionsOf(::ResourceLocation const& resourceLocation) const = 0;
54
55#ifdef LL_PLAT_C
56 virtual ::mce::Image loadTexture(::ResourceLocation const& resourceLocation) const = 0;
57
58#endif
59 virtual bool isInStreamableLocation(::ResourceLocation const& resourceLocation) const;
60
61 virtual bool isInStreamableLocation(
62 ::ResourceLocation const& resourceLocation,
63 ::gsl::span<::std::string const> extensionList
64 ) const;
65
66 virtual ::Core::PathBuffer<::std::string> getPath(::ResourceLocation const& resourceLocation) const;
67
68 virtual ::Core::PathBuffer<::std::string>
69 getPath(::ResourceLocation const& resourceLocation, ::gsl::span<::std::string const> extensionList) const;
70
71 virtual ::Core::PathBuffer<::std::string>
72 getPathContainingResource(::ResourceLocation const& resourceLocation) const;
73
74 virtual ::Core::PathBuffer<::std::string> getPathContainingResource(
75 ::ResourceLocation const& resourceLocation,
76 ::gsl::span<::std::string const> extensionList
77 ) const;
78
79 virtual ::std::pair<int, ::std::string_view> getPackStackIndexOfResource(
80 ::ResourceLocation const& resourceLocation,
81 ::gsl::span<::std::string const> extensionList
82 ) const;
83 // NOLINTEND
84
85public:
86 // member functions
87 // NOLINTBEGIN
88 MCAPI explicit ResourceLoader(::std::function<::Core::PathBuffer<::std::string>()> getPath);
89 // NOLINTEND
90
91public:
92 // constructor thunks
93 // NOLINTBEGIN
94 MCAPI void* $ctor(::std::function<::Core::PathBuffer<::std::string>()> getPath);
95 // NOLINTEND
96
97public:
98 // virtual function thunks
99 // NOLINTBEGIN
100 MCFOLD bool $load(
101 ::ResourceLocationPair const& resourceLocationPair,
102 ::std::string& resourceStream,
103 ::gsl::span<::std::string const> extensionList
104 ) const;
105
106 MCFOLD bool $loadText(::ResourceLocation const& resourceLocation, ::std::string& resourceStream) const;
107
108 MCFOLD bool $isInStreamableLocation(::ResourceLocation const& resourceLocation) const;
109
110 MCFOLD bool $isInStreamableLocation(
111 ::ResourceLocation const& resourceLocation,
112 ::gsl::span<::std::string const> extensionList
113 ) const;
114
115 MCAPI ::Core::PathBuffer<::std::string> $getPath(::ResourceLocation const& resourceLocation) const;
116
117 MCFOLD ::Core::PathBuffer<::std::string>
118 $getPath(::ResourceLocation const& resourceLocation, ::gsl::span<::std::string const> extensionList) const;
119
120 MCFOLD ::Core::PathBuffer<::std::string>
121 $getPathContainingResource(::ResourceLocation const& resourceLocation) const;
122
123 MCFOLD ::Core::PathBuffer<::std::string> $getPathContainingResource(
124 ::ResourceLocation const& resourceLocation,
125 ::gsl::span<::std::string const> extensionList
126 ) const;
127
128 MCAPI ::std::pair<int, ::std::string_view> $getPackStackIndexOfResource(
129 ::ResourceLocation const& resourceLocation,
130 ::gsl::span<::std::string const> extensionList
131 ) const;
132
133
134 // NOLINTEND
135
136public:
137 // vftables
138 // NOLINTBEGIN
139 MCNAPI static void** $vftable();
140 // NOLINTEND
141};
Definition EnableNonOwnerReferences.h:7
Definition PathBuffer.h:8
Definition LoadedResourceData.h:5
static MCAPI void ** $vftable()
Definition ResourceLocationPair.h:9
Definition ResourceLocation.h:15
Definition Image.h:13