![]() |
Rendering Engine 0.2.0
Modular Graphics Rendering Engine | v0.2.0
|
Provides static helper methods for file I/O and path management. More...
#include <utility.hpp>
Static Public Member Functions | |
| static void | InitializePaths (int argc, char *argv[]) |
| Initializes engine paths based on the executable location. | |
| static AppConfig | ReadConfigFile () |
| Reads application settings from the JSON config file. | |
| static std::vector< char > | ReadShaderBinaryFile (std::string const &filename) |
| Reads a binary shader file from disk. | |
| static std::vector< std::string > | GetListOfFilesInDirectory (std::string directory) |
| Returns a list of full file paths in the given directory. | |
| static boost::filesystem::path | GetApplicationPath () |
| Returns the absolute path of the running application. | |
| static boost::filesystem::path | GetBuildPath () |
| Returns the build output directory path. | |
| static boost::filesystem::path | GetShadersBinaryPath () |
| Returns the directory path containing compiled shader binaries. | |
| static std::vector< std::string > | GetListOfFileNamesInDirectory (const char *directory, std::string extToSearch) |
| Returns a list of file names in a directory matching the specified extension. | |
| static boost::filesystem::path | ResolveProjectRoot () |
| Resolves project root folder (handles Release/Debug/Binaries layouts). | |
| static boost::filesystem::path | GetTextureFolderPath () |
| Returns absolute path to Content/Textures. | |
| static boost::filesystem::path | GetModelsFolderPath () |
| Returns absolute path to Content/Models. | |
| static boost::filesystem::path | GetShadersFolderPath () |
| Returns absolute path to Content/Shaders. | |
| static boost::filesystem::path | GetConfigFilePath () |
| Returns absolute path to Config/app_config.json. | |
| static bool | IsPackageProvided () |
| Checks whether packed assets (Pack.bin / Pack.json) exist. | |
| static const PackEntries & | GetPackEntries () |
| Returns the manifest of packed files. | |
| static std::vector< uint8_t > | ReadPackedFile (const std::string &entryPath) |
| Reads raw bytes of a file stored inside Pack.bin. | |
Static Public Attributes | |
| static boost::filesystem::path | sApplicationPath |
| static boost::filesystem::path const | sDefaultShadersBinaryRelativePath = {"/Content/Shaders/"} |
| static boost::filesystem::path | sBuildPath |
| static boost::filesystem::path | sShadersBinaryPath |
| static boost::filesystem::path const | sContentRelativePathFolder = path{} / "Content" |
| static boost::filesystem::path const | sContentPackageFilePath = path{} / "Content" / "Pack.bin" |
| static boost::filesystem::path const | sContentPackEntriesFilePath = path{} / "Content" / "Pack.json" |
| static boost::filesystem::path const | sTextureRelativePathFolder = sContentRelativePathFolder / "Textures" |
| static boost::filesystem::path const | sModelsRelativePathFolder = sContentRelativePathFolder / "Models" |
| static boost::filesystem::path const | sShadersRelativePathFolder = sContentRelativePathFolder / "Shaders" |
| static boost::filesystem::path const | sAppConfigFilePath = path{} / "Config" / "app_config.json" |
Provides static helper methods for file I/O and path management.
The Utility class centralizes filesystem operations such as locating shader binaries, listing files, and resolving build or application paths.
All methods are static and thread-safe, designed for use throughout the engine.
Definition at line 59 of file utility.hpp.
|
static |
Returns the absolute path of the running application.
Definition at line 120 of file utility.cpp.
|
static |
Returns the build output directory path.
Definition at line 125 of file utility.cpp.
|
static |
Returns absolute path to Config/app_config.json.
Definition at line 207 of file utility.cpp.
|
static |
Returns a list of file names in a directory matching the specified extension.
| directory | Directory path. |
| extToSearch | File extension to match (e.g., ".spv"). |
Definition at line 149 of file utility.cpp.
|
static |
Returns a list of full file paths in the given directory.
| directory | Directory path to search. |
Definition at line 86 of file utility.cpp.
|
static |
Returns absolute path to Content/Models.
Definition at line 197 of file utility.cpp.
|
static |
Returns the manifest of packed files.
Definition at line 219 of file utility.cpp.
|
static |
Returns the directory path containing compiled shader binaries.
Definition at line 130 of file utility.cpp.
|
static |
Returns absolute path to Content/Shaders.
Definition at line 202 of file utility.cpp.
|
static |
Returns absolute path to Content/Textures.
Definition at line 192 of file utility.cpp.
|
static |
Initializes engine paths based on the executable location.
Should be called once during startup to establish base directories for application, build, and shader assets.
| argc | Command-line argument count. |
| argv | Command-line argument vector. |
Definition at line 24 of file utility.cpp.
|
static |
Checks whether packed assets (Pack.bin / Pack.json) exist.
Definition at line 212 of file utility.cpp.
|
static |
Reads application settings from the JSON config file.
Missing or invalid fields fall back to default AppConfig values.
Definition at line 32 of file utility.cpp.
|
static |
Reads raw bytes of a file stored inside Pack.bin.
| entryPath | Virtual path inside the pack (e.g. "Textures/my.png"). |
Definition at line 260 of file utility.cpp.
|
static |
Reads a binary shader file from disk.
| filename | Path to the shader file. |
Definition at line 66 of file utility.cpp.
|
static |
Resolves project root folder (handles Release/Debug/Binaries layouts).
Definition at line 182 of file utility.cpp.
|
static |
Definition at line 166 of file utility.hpp.
|
static |
Definition at line 156 of file utility.hpp.
|
static |
Definition at line 158 of file utility.hpp.
|
static |
Definition at line 161 of file utility.hpp.
|
static |
Definition at line 162 of file utility.hpp.
|
static |
Definition at line 160 of file utility.hpp.
|
static |
Definition at line 157 of file utility.hpp.
|
static |
Definition at line 164 of file utility.hpp.
|
static |
Definition at line 159 of file utility.hpp.
|
static |
Definition at line 165 of file utility.hpp.
|
static |
Definition at line 163 of file utility.hpp.