8#include "Engine/Files/GeneratedAssetManifest.h"
20 for (
size_t i = 0; i < N; ++i) {
21 path_[i] = literal[i];
26 [[nodiscard]]
constexpr std::string_view
view()
const {
return {
path_.data(),
length_}; }
28 [[nodiscard]] std::filesystem::path
fsPath()
const
30 return std::filesystem::path(
view());
33 [[nodiscard]] std::string
string()
const
35 return std::string(
view());
38 [[nodiscard]]
constexpr const char*
c_str()
const
43 operator std::filesystem::path()
const {
return fsPath(); }
46 [[nodiscard]]
constexpr auto operator/(
const char (&other)[M])
const
48 constexpr size_t leftChars = N - 1;
49 constexpr size_t rightChars = M - 1;
50 constexpr size_t resultChars = leftChars + 1 + rightChars;
54 for (
size_t i = 0; i <
length_; ++i) {
58 result.
path_[out++] =
'/';
60 for (
size_t i = 0; i < rightChars; ++i) {
61 result.
path_[out++] = other[i];
63 result.
path_[out] =
'\0';
68 std::filesystem::path
operator/(
const std::filesystem::path & other )
const
73 std::filesystem::path
operator/(std::string_view other)
const
92 return stream << path.
view();
98 return Assets::GeneratedAssetManifest::contains(path.
view());
153#define CREATE_ASSET_PATH(assetPath) \
155 constexpr auto verifiedAssetPath = (assetPath); \
156 static_assert(::Engine::Core::assetExists(verifiedAssetPath), \
157 "Asset path is not present in GeneratedAssetManifest"); \
158 return verifiedAssetPath; \
constexpr const char * c_str() const
std::filesystem::path operator/(std::string_view other) const
std::array< char, N > path_
constexpr ConstexprPath(const char(&literal)[N])
constexpr std::string_view view() const
std::string string() const
friend class ConstexprPath
constexpr auto operator/(const char(&other)[M]) const
std::filesystem::path fsPath() const
constexpr ConstexprPath()=default
std::filesystem::path operator/(const std::filesystem::path &other) const
static constexpr auto engineFonts()
Path to font assets.
static constexpr auto engineTextures()
Path to engine textures.
static bool doesExrFileExist(const std::filesystem::path &path)
static std::string getEngineRoot()
static bool doesGltfFileExist(const std::filesystem::path &path)
static constexpr auto engineGeometry()
Path to engine geometry assets.
static constexpr auto engineShaders()
Path to engine shaders.
static bool doesFileExist(const std::filesystem::path &path)
static constexpr auto engineSounds()
Path to engine audio files.
static constexpr std::string getProjectRoot()
Gets the root location of the whole game. This is.
Core audio subsystem owning the miniaudio engine and managing playback.
consteval bool assetExists(const ConstexprPath< N > &path)
ConstexprPath(const char(&)[N]) -> ConstexprPath< N >
std::ostream & operator<<(std::ostream &stream, const ConstexprPath< N > &path)