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*/;
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#ifdef LL_PLAT_S
46 virtual bool load(
47 ::ResourceLocationPair const& resourceLocationPair,
48 ::std::string& resourceStream,
49 ::gsl::span<::std::string const> extensionList
50 ) const;
51#else // LL_PLAT_C
52 virtual bool load(
53 ::ResourceLocationPair const& resourceLocation,
54 ::std::string& resourceStream,
55 ::gsl::span<::std::string const> extensionList
56 ) const;
57#endif
58
59 virtual bool loadText(::ResourceLocation const& resourceLocation, ::std::string& resourceStream) const;
60
61 virtual ::std::vector<::LoadedResourceData> loadAllVersionsOf(::ResourceLocation const& resourceLocation) const = 0;
62
63#ifdef LL_PLAT_C
64 virtual ::mce::Image loadTexture(::ResourceLocation const& resourceLocation) const = 0;
65
66#endif
67 virtual bool isInStreamableLocation(::ResourceLocation const& resourceLocation) const;
68
69 virtual bool isInStreamableLocation(
70 ::ResourceLocation const& resourceLocation,
71 ::gsl::span<::std::string const> extensionList
72 ) const;
73
74 virtual ::Core::PathBuffer<::std::string> getPath(::ResourceLocation const& resourceLocation) const;
75
76 virtual ::Core::PathBuffer<::std::string>
77 getPath(::ResourceLocation const& resourceLocation, ::gsl::span<::std::string const> extensionList) const;
78
79 virtual ::Core::PathBuffer<::std::string>
80 getPathContainingResource(::ResourceLocation const& resourceLocation) const;
81
82 virtual ::Core::PathBuffer<::std::string> getPathContainingResource(
83 ::ResourceLocation const& resourceLocation,
84 ::gsl::span<::std::string const> extensionList
85 ) const;
86
87 virtual ::std::pair<int, ::std::string_view> getPackStackIndexOfResource(
88 ::ResourceLocation const& resourceLocation,
89 ::gsl::span<::std::string const> extensionList
90 ) const;
91 // NOLINTEND
92
93public:
94 // member functions
95 // NOLINTBEGIN
96 MCAPI explicit ResourceLoader(::std::function<::Core::PathBuffer<::std::string>()> getPath);
97 // NOLINTEND
98
99public:
100 // constructor thunks
101 // NOLINTBEGIN
102 MCAPI void* $ctor(::std::function<::Core::PathBuffer<::std::string>()> getPath);
103 // NOLINTEND
104
105public:
106 // destructor thunk
107 // NOLINTBEGIN
108 MCAPI void $dtor();
109 // NOLINTEND
110
111public:
112 // virtual function thunks
113 // NOLINTBEGIN
114 MCFOLD bool $load(
115 ::ResourceLocationPair const& resourceLocationPair,
116 ::std::string& resourceStream,
117 ::gsl::span<::std::string const> extensionList
118 ) const;
119
120 MCFOLD bool $loadText(::ResourceLocation const& resourceLocation, ::std::string& resourceStream) const;
121
122 MCFOLD bool $isInStreamableLocation(::ResourceLocation const& resourceLocation) const;
123
124 MCFOLD bool $isInStreamableLocation(
125 ::ResourceLocation const& resourceLocation,
126 ::gsl::span<::std::string const> extensionList
127 ) const;
128
129 MCAPI ::Core::PathBuffer<::std::string> $getPath(::ResourceLocation const& resourceLocation) const;
130
131 MCFOLD ::Core::PathBuffer<::std::string>
132 $getPath(::ResourceLocation const& resourceLocation, ::gsl::span<::std::string const> extensionList) const;
133
134 MCFOLD ::Core::PathBuffer<::std::string>
135 $getPathContainingResource(::ResourceLocation const& resourceLocation) const;
136
137 MCFOLD ::Core::PathBuffer<::std::string> $getPathContainingResource(
138 ::ResourceLocation const& resourceLocation,
139 ::gsl::span<::std::string const> extensionList
140 ) const;
141
142 MCAPI ::std::pair<int, ::std::string_view> $getPackStackIndexOfResource(
143 ::ResourceLocation const& resourceLocation,
144 ::gsl::span<::std::string const> extensionList
145 ) const;
146
147
148 // NOLINTEND
149
150public:
151 // vftables
152 // NOLINTBEGIN
153 MCNAPI static void** $vftable();
154 // NOLINTEND
155};
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:12