Elevate Engine 1
Loading...
Searching...
No Matches
PathResolver.cpp
Go to the documentation of this file.
1#include "PathResolver.h"
2
5
6std::string Elevate::PathResolver::Resolve(const std::string& virtualPath)
7{
8 if (virtualPath.starts_with("engine://"))
9 {
10 return std::string(EE_ENGINE_DIR) + virtualPath.substr(9);
11 }
12 else if (virtualPath.starts_with("editor://"))
13 {
14#ifndef EE_EDITOR_BUILD
15 EE_CORE_ERROR("You cannot use editor:// path while building without the editor.");
16 return virtualPath;
17#else
18 return std::string(EE_EDITOR_DIR) + virtualPath.substr(9);
19#endif
20 }
21 else if (virtualPath.starts_with("content://"))
22 {
23 return std::string(EE_CONTENT_ROOT) + virtualPath.substr(10);
24 }
25 return virtualPath;
26}
#define EE_ENGINE_DIR
Definition Core.h:35
#define EE_CONTENT_ROOT
Definition Core.h:41
#define EE_EDITOR_DIR
Definition Core.h:36
static std::string Resolve(const std::string &virtualPath)