![]() |
Rendering Engine 0.2.9
Modular Graphics Rendering Engine | v0.2.9
|
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. More... | |
| static AppConfig | ReadConfigFile () |
| Reads application settings from the JSON config file. More... | |
| static std::vector< char > | ReadShaderBinaryFile (std::string const &filename) |
| Reads a binary shader file from disk. More... | |
| static std::vector< std::string > | GetListOfFilesInDirectory (std::string directory) |
| Returns a list of full file paths in the given directory. More... | |
| static boost::filesystem::path | GetApplicationPath () |
| Returns the absolute path of the running application. More... | |
| static boost::filesystem::path | GetBuildPath () |
| Returns the build output directory path. More... | |
| static boost::filesystem::path | GetShadersBinaryPath () |
| Returns the directory path containing compiled shader binaries. More... | |
| 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. More... | |
| static boost::filesystem::path | ResolveProjectRoot () |
| Resolves project root folder (handles Release/Debug/Binaries layouts). More... | |
| static boost::filesystem::path | GetContentFolderPath () |
| Returns absolute path to Content. More... | |
| static boost::filesystem::path | GetTextureFolderPath () |
| Returns absolute path to Content/Textures. More... | |
| static boost::filesystem::path | GetModelsFolderPath () |
| Returns absolute path to Content/Models. More... | |
| static boost::filesystem::path | GetFontsFolderPath () |
| Returns absolute path to Content/Fonts. More... | |
| static boost::filesystem::path | GetShadersFolderPath () |
| Returns absolute path to Content/Shaders. More... | |
| static boost::filesystem::path | GetConfigFilePath () |
| Returns absolute path to Config/app_config.json. More... | |
| static boost::filesystem::path | GetLogsFolderPath () |
| Returns absolute path to Logs folder. More... | |
| static bool | IsPackageProvided () |
| Checks whether packed assets (Pack.bin / Pack.json) exist. More... | |
| static const PackEntries & | GetPackEntries () |
| Returns the manifest of packed files. More... | |
| static std::vector< uint8_t > | ReadPackedFile (const std::string &entryPath) |
| Reads raw bytes of a file stored inside Pack.bin. More... | |
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 | sFontsRelativePathFolder = sContentRelativePathFolder / "Fonts" |
| static boost::filesystem::path const | sShadersRelativePathFolder = sContentRelativePathFolder / "Shaders" |
| static boost::filesystem::path const | sAppConfigFilePath = path{} / "Config" / "app_config.json" |
| static boost::filesystem::path const | sLogFolderPath = path{} / "Logs" |
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 71 of file utility.hpp.
|
static |
Returns the absolute path of the running application.
Definition at line 167 of file utility.cpp.
|
static |
Returns the build output directory path.
Definition at line 172 of file utility.cpp.
|
static |
Returns absolute path to Config/app_config.json.
Definition at line 264 of file utility.cpp.
|
static |
Returns absolute path to Content.
Definition at line 239 of file utility.cpp.
|
static |
Returns absolute path to Content/Fonts.
Definition at line 254 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 196 of file utility.cpp.
|
static |
Returns a list of full file paths in the given directory.
| directory | Directory path to search. |
Definition at line 133 of file utility.cpp.
|
static |
Returns absolute path to Logs folder.
Definition at line 269 of file utility.cpp.
|
static |
Returns absolute path to Content/Models.
Definition at line 249 of file utility.cpp.
|
static |
Returns the manifest of packed files.
Definition at line 281 of file utility.cpp.
|
static |
Returns the directory path containing compiled shader binaries.
Definition at line 177 of file utility.cpp.
|
static |
Returns absolute path to Content/Shaders.
Definition at line 259 of file utility.cpp.
|
static |
Returns absolute path to Content/Textures.
Definition at line 244 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 26 of file utility.cpp.
|
static |
Checks whether packed assets (Pack.bin / Pack.json) exist.
Definition at line 274 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 34 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 322 of file utility.cpp.
|
static |
Reads a binary shader file from disk.
| filename | Path to the shader file. |
Definition at line 113 of file utility.cpp.
|
static |
Resolves project root folder (handles Release/Debug/Binaries layouts).
Definition at line 229 of file utility.cpp.
|
static |
Definition at line 188 of file utility.hpp.
|
static |
Definition at line 177 of file utility.hpp.
|
static |
Definition at line 179 of file utility.hpp.
|
static |
Definition at line 182 of file utility.hpp.
|
static |
Definition at line 183 of file utility.hpp.
|
static |
Definition at line 181 of file utility.hpp.
|
static |
Definition at line 178 of file utility.hpp.
|
static |
Definition at line 186 of file utility.hpp.
|
static |
Definition at line 189 of file utility.hpp.
|
static |
Definition at line 185 of file utility.hpp.
|
static |
Definition at line 180 of file utility.hpp.
|
static |
Definition at line 187 of file utility.hpp.
|
static |
Definition at line 184 of file utility.hpp.