Skip to content
LeviMC
English
AutoLightDark
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
13namespace mce { struct Image; }
14// clang-format on
15
16class ResourceLoader : public ::Bedrock::EnableNonOwnerReferences {
17public:
18 // ResourceLoader inner types define
19 using ResourceFileExtensionSetType = ::gsl::span<::std::string const>;
20
21public:
22 // member variables
23 // NOLINTBEGIN
24 ::ll::TypedStorage<8, 64, ::std::function<::Core::PathBuffer<::std::string>()>> mGetPath;
25 // NOLINTEND
26
27public:
28 // prevent constructor by default
29 ResourceLoader();
30
31public:
32 // virtual functions
33 // NOLINTBEGIN
34 virtual ~ResourceLoader() /*override*/ = default;
35
36 virtual bool load(::ResourceLocation const& resourceLocation, ::std::string& resourceStream) const = 0;
37
38#ifdef LL_PLAT_S
39 virtual bool load(
40 ::ResourceLocation const& resourceLocation,
41 ::std::string& resourceStream,
42 ::gsl::span<::std::string const> extensionList
43 ) const = 0;
44#else // LL_PLAT_C
45 virtual bool load(
46 ::ResourceLocation const& resourceLocation,
47 ::std::string& resourceStream,
48 ::gsl::span<::std::string const> extensions
49 ) const = 0;
50#endif
51
52#ifdef LL_PLAT_S
53 virtual bool load(
54 ::ResourceLocationPair const& resourceLocationPair,
55 ::std::string& resourceStream,
56 ::gsl::span<::std::string const> extensionList
57 ) const = 0;
58#else // LL_PLAT_C
59 virtual bool load(
60 ::ResourceLocationPair const& resourceLocation,
61 ::std::string& resourceStream,
62 ::gsl::span<::std::string const> extensions
63 ) const = 0;
64
65 virtual ::mce::Image loadTexture(::ResourceLocation const& resourceLocation) const = 0;
66#endif
67
68 virtual ::Core::PathBuffer<::std::string> getPath(::ResourceLocation const& resourceLocation) const = 0;
69
70#ifdef LL_PLAT_S
71 virtual ::Core::PathBuffer<::std::string>
72 getPath(::ResourceLocation const& resourceLocation, ::gsl::span<::std::string const> extensionList) const = 0;
73#else // LL_PLAT_C
74 virtual ::Core::PathBuffer<::std::string>
75 getPath(::ResourceLocation const& resourceLocation, ::gsl::span<::std::string const> extensions) const = 0;
76#endif
77
78 virtual ::Core::PathBuffer<::std::string>
79 getPathContainingResource(::ResourceLocation const& resourceLocation) const = 0;
80
81#ifdef LL_PLAT_S
82 virtual ::std::pair<int, ::std::string_view> getPackStackIndexOfResource(
83 ::ResourceLocation const& resourceLocation,
84 ::gsl::span<::std::string const> extensionList
85 ) const = 0;
86#else // LL_PLAT_C
87 virtual ::std::pair<int, ::std::string_view> getPackStackIndexOfResource(
88 ::ResourceLocation const& resourceLocation,
89 ::gsl::span<::std::string const> extensions
90 ) const = 0;
91#endif
92
93 // NOLINTEND
94
95public:
96 // member functions
97 // NOLINTBEGIN
98 MCNAPI explicit ResourceLoader(::std::function<::Core::PathBuffer<::std::string>()> getPath);
99 // NOLINTEND
100
101public:
102 // constructor thunks
103 // NOLINTBEGIN
104 MCNAPI void* $ctor(::std::function<::Core::PathBuffer<::std::string>()> getPath);
105 // NOLINTEND
106
107public:
108 // vftables
109 // NOLINTBEGIN
110 MCNAPI static void** $vftable();
111 // NOLINTEND
112};
Definition EnableNonOwnerReferences.h:7
Definition PathBuffer.h:8
MCAPI ResourceLoader(::std::function<::Core::PathBuffer<::std::string >()> getPath)
static MCAPI void ** $vftable()
MCAPI void * $ctor(::std::function<::Core::PathBuffer<::std::string >()> getPath)
Definition ResourceLocationPair.h:9
Definition ResourceLocation.h:15
Definition Image.h:13