FPaths
- Module
- Core
- Header
#include "Core/FPaths.h"- Namespace
Mowo
Public functions
| Returns | Name | Description |
|---|---|---|
const std::string& | EngineDir | Root of the engine checkout or install — the directory holding Engine/EngineManifest.json, with Templates/ and Samples/ beside Engine/. |
std::string | EngineContentDir | Engine/Content — assets shipped with the engine. |
std::string | EngineSourceDir | Engine/Source — source tree (Editor-only): Runtime/, Editor/, Developer/, Programs/ and ThirdParty/. |
std::string | EngineModuleDir | Engine/Source/<Group>/<Module> — an engine module's folder, whichever of Runtime, Editor, Developer or Programs holds it; empty when none does. |
std::string | EngineThirdPartyDir | Engine/Source/ThirdParty — vendored libraries' headers, rules and Lib/. |
std::string | EngineConfigDir | Engine/Config — the Base*.ini layer under every project's INI configs. |
std::string | EngineShadersDir | Engine/Shaders — the engine's HLSL. |
std::string | EnginePluginsDir | Engine/Plugins — the engine's own plugins. |
std::string | EngineBinariesDir | Engine/Binaries/<platform>/<config> — the default build of this binary's configuration (a variant build such as dev-server or debug-asan links into a sibling folder; ExecutableDir names that one). |
std::string | EngineThirdPartyBinariesDir | Engine/Binaries/ThirdParty/<Library>/<platform> — a vendored library's runtime files and tools (astcenc, DXC, the D3D12 Agility SDK). |
std::string | ThirdPartyToolExecutable | A vendored tool's executable in that folder, the platform's extension added: EngineThirdPartyBinariesDir("astcenc") + "/astcenc.exe" on Windows. |
std::string | EngineIntermediateDir | Engine/Intermediate — disposable build output (objects, generated code). |
std::string | BuildToolExecutable | Engine/Source/Programs/MowoBuildTool/publish/mbt[.exe] — the published build tool every editor-driven build, cook and package runs. |
std::string | TemplatesDir | Templates/ beside Engine/ — the project templates and TemplateResources/. |
std::string | SamplesDir | Samples/ beside Engine/. |
std::string | SampleProjectFile | Samples/SampleProject/SampleProject.mproject — the clean example project. |
std::string | StarterContentDir | Samples/StarterContent — the optional CC0 pack a new project can add. |
std::string | TestProjectFile | Engine/Source/Developer/MowoTestKit/Fixtures/TestProject/TestProject.mproject — the project the smokes, benches and test rows open: every test scene, golden material sidecar and design fixture lives there, not in the sample. |
const std::string& | ExecutableDir | Directory holding the running executable. |
const std::string& | GameRootDir | Root of a packaged game bundle — the directory holding Game.mproject (or the legacy game.mproject). |
bool | IsPackagedRun | True when this process runs out of a packaged bundle whose root is not meant to be written (BuildInfo.json present, or the root is not writable — e.g. |
void | SetPackagedRun | Set by the runtime host once the shipping manifest / writability probe has run. |
std::string | UserConfigScratchDir | A private per-process directory standing in for every per-user config location while user config is ignored (--no-user-config, or a host that asked through SetIgnoreUserConfig); empty when user config is honoured. |
void | SetIgnoreUserConfig | |
const std::string& | ProjectDir | Current project root — the directory containing the .mproject file loaded at startup. |
std::string | ProjectContentDir | Project/Content — game asset source files. |
std::string | ProjectConfigDir | Project/Config — the project tier of the tiered config. |
std::string | ProjectSourceDir | Project/Source — the project's C++ game module. |
std::string | ProjectSavedDir | Project/Saved — runtime-written stuff that's NOT in source control. |
std::string | ProjectLogsDir | Project/Saved/Logs — engine writes mowo_engine.log here. |
std::string | ProjectCrashesDir | Project/Saved/Crashes — minidumps + Sentry upload queue. |
std::string | ProjectAutosavesDir | Project/Saved/Autosaves |
std::string | ProjectSaveGamesDir | Project/Saved/SaveGames |
std::string | ProjectScreenshotsDir | Project/Saved/Screenshots |
std::string | ProjectIntermediateDir | Project/Intermediate — disposable derived output (DDC, thumbnail cache, generated code). |
std::string | UserDir | Per-user, per-product state root (%LOCALAPPDATA%/<Product> on Windows, XDG state dir elsewhere) — for data that follows the user across projects. |
std::string | UserSaveGamesDir | Per-user savegame root: <Product>/Saved/SaveGames under the state root. |
std::string | UserPipelineCacheDir | Per-user, per-product GPU pipeline-cache directory (<Product>/Cache under the cache root) — two games never share one cache blob. |
std::string | Combine | Single forward-slash separator, no trailing slash on the result. |
std::string | StripExtension | Drops everything from the last '.'; returns the input unchanged when there is no '.'. |
std::string | GetExtension | The extension including the leading dot (".png"); empty when the clean filename has no '.'. |
std::string | GetLowerExtension | GetExtension folded to ASCII lower case, for matching against the file-type table. |
std::string | GetStem | The clean filename with its extension dropped ("Textures/foo.png" -> "foo"). |
std::string | GetCleanFilename | The part after the last slash. |
std::string | GetPath | The part before the last slash. |
std::string | NormalizeSeparators | Every '\' becomes '/'. |
void | SetProjectDir | Pass an absolute path; every Project*Dir call afterwards derives from it. |
Function details
EngineDir
static const std::string& EngineDir()Root of the engine checkout or install — the directory holding Engine/EngineManifest.json, with Templates/ and Samples/ beside Engine/. Walks up from the program path (Engine/Binaries/<platform>/<config>/), then from the working directory; the working directory itself when neither finds it.
EngineContentDir
static std::string EngineContentDir()Engine/Content — assets shipped with the engine.
EngineSourceDir
static std::string EngineSourceDir()Engine/Source — source tree (Editor-only): Runtime/, Editor/, Developer/, Programs/ and ThirdParty/.
EngineModuleDir
static std::string EngineModuleDir(std::string_view moduleName)Engine/Source/<Group>/<Module> — an engine module's folder, whichever of Runtime, Editor, Developer or Programs holds it; empty when none does.
EngineThirdPartyDir
static std::string EngineThirdPartyDir()Engine/Source/ThirdParty — vendored libraries' headers, rules and Lib/.
EngineConfigDir
static std::string EngineConfigDir()Engine/Config — the Base*.ini layer under every project's INI configs.
EngineShadersDir
static std::string EngineShadersDir()Engine/Shaders — the engine's HLSL.
EnginePluginsDir
static std::string EnginePluginsDir()Engine/Plugins — the engine's own plugins.
EngineBinariesDir
static std::string EngineBinariesDir()Engine/Binaries/<platform>/<config> — the default build of this binary's configuration (a variant build such as dev-server or debug-asan links into a sibling folder; ExecutableDir names that one).
EngineThirdPartyBinariesDir
static std::string EngineThirdPartyBinariesDir(std::string_view library)Engine/Binaries/ThirdParty/<Library>/<platform> — a vendored library's runtime files and tools (astcenc, DXC, the D3D12 Agility SDK).
ThirdPartyToolExecutable
static std::string ThirdPartyToolExecutable(std::string_view library, std::string_view tool)A vendored tool's executable in that folder, the platform's extension added: EngineThirdPartyBinariesDir("astcenc") + "/astcenc.exe" on Windows.
EngineIntermediateDir
static std::string EngineIntermediateDir()Engine/Intermediate — disposable build output (objects, generated code).
BuildToolExecutable
static std::string BuildToolExecutable()Engine/Source/Programs/MowoBuildTool/publish/mbt[.exe] — the published build tool every editor-driven build, cook and package runs.
TemplatesDir
static std::string TemplatesDir()Templates/ beside Engine/ — the project templates and TemplateResources/.
SamplesDir
static std::string SamplesDir()Samples/ beside Engine/.
SampleProjectFile
static std::string SampleProjectFile()Samples/SampleProject/SampleProject.mproject — the clean example project.
StarterContentDir
static std::string StarterContentDir()Samples/StarterContent — the optional CC0 pack a new project can add.
TestProjectFile
static std::string TestProjectFile()Engine/Source/Developer/MowoTestKit/Fixtures/TestProject/TestProject.mproject — the project the smokes, benches and test rows open: every test scene, golden material sidecar and design fixture lives there, not in the sample.
ExecutableDir
static const std::string& ExecutableDir()Directory holding the running executable. Unlike everything else here it never consults the working directory, so it is the right anchor for a packaged game's own files — those must resolve however the player launched the exe.
GameRootDir
static const std::string& GameRootDir()Root of a packaged game bundle — the directory holding Game.mproject (or the legacy game.mproject). Probes the working directory, the executable dir, and up to two parents of the executable dir (the packaged host lives in <root>/Binaries/<platform>/). Empty when no packaged root is found (dev tree, editor).
IsPackagedRun
static bool IsPackagedRun()True when this process runs out of a packaged bundle whose root is not meant to be written (BuildInfo.json present, or the root is not writable — e.g. Program Files). Saved/ + derived data then route to the per-user product dirs instead of the install dir.
SetPackagedRun
static void SetPackagedRun(bool packaged)Set by the runtime host once the shipping manifest / writability probe has run.
UserConfigScratchDir
static std::string UserConfigScratchDir()A private per-process directory standing in for every per-user config location while user config is ignored (--no-user-config, or a host that asked through SetIgnoreUserConfig); empty when user config is honoured. A test run reads the same defaults on every machine and writes nothing the next run, or the user, will pick up.
SetIgnoreUserConfig
static void SetIgnoreUserConfig(bool ignore)ProjectDir
static const std::string& ProjectDir()Current project root — the directory containing the .mproject file loaded at startup. Empty when no project is loaded (--no-project / Launcher-only mode).
ProjectContentDir
static std::string ProjectContentDir()Project/Content — game asset source files.
ProjectConfigDir
static std::string ProjectConfigDir()Project/Config — the project tier of the tiered config.
ProjectSourceDir
static std::string ProjectSourceDir()Project/Source — the project's C++ game module.
ProjectSavedDir
static std::string ProjectSavedDir()Project/Saved — runtime-written stuff that's NOT in source control. Logs, crashes, autosaves, savegames, screenshots.
ProjectLogsDir
static std::string ProjectLogsDir()Project/Saved/Logs — engine writes mowo_engine.log here.
ProjectCrashesDir
static std::string ProjectCrashesDir()Project/Saved/Crashes — minidumps + Sentry upload queue.
ProjectAutosavesDir
static std::string ProjectAutosavesDir()Project/Saved/Autosaves
ProjectSaveGamesDir
static std::string ProjectSaveGamesDir()Project/Saved/SaveGames
ProjectScreenshotsDir
static std::string ProjectScreenshotsDir()Project/Saved/Screenshots
ProjectIntermediateDir
static std::string ProjectIntermediateDir()Project/Intermediate — disposable derived output (DDC, thumbnail cache, generated code). Safe to delete at any time.
UserDir
static std::string UserDir()Per-user, per-product state root (%LOCALAPPDATA%/<Product> on Windows, XDG state dir elsewhere) — for data that follows the user across projects. Re-resolves when AppDataPath::SetProductName changes.
UserSaveGamesDir
static std::string UserSaveGamesDir()Per-user savegame root: <Product>/Saved/SaveGames under the state root. A packaged game writes here directly; the editor/PIE adds a per-project subdirectory (see SaveGameManager::GetSaveDir).
UserPipelineCacheDir
static std::string UserPipelineCacheDir()Per-user, per-product GPU pipeline-cache directory (<Product>/Cache under the cache root) — two games never share one cache blob.
Combine
static std::string Combine(std::string_view a, std::string_view b)Single forward-slash separator, no trailing slash on the result.
StripExtension
static std::string StripExtension(std::string_view path)Drops everything from the last '.'; returns the input unchanged when there is no '.'.
GetExtension
static std::string GetExtension(std::string_view path)The extension including the leading dot (".png"); empty when the clean filename has no '.'. A '.' in a parent directory is ignored.
GetLowerExtension
static std::string GetLowerExtension(std::string_view path)GetExtension folded to ASCII lower case, for matching against the file-type table.
GetStem
static std::string GetStem(std::string_view path)The clean filename with its extension dropped ("Textures/foo.png" -> "foo").
GetCleanFilename
static std::string GetCleanFilename(std::string_view path)The part after the last slash.
GetPath
static std::string GetPath(std::string_view path)The part before the last slash.
NormalizeSeparators
static std::string NormalizeSeparators(std::string path)Every '\' becomes '/'. A path that came back from std::filesystem on Windows carries the host separator, and a path used as a MAP KEY — the asset registry's path index, a redirect's old path — then fails to match the same path spelled the engine's way.
SetProjectDir
static void SetProjectDir(std::string absoluteDir)Pass an absolute path; every Project*Dir call afterwards derives from it. Empty string resets to "no project loaded".