![]() |
Lysa
0.0
Lysa 3D Engine
|
Virtual file system helper used to resolve portable paths.
Notes:
Static Public Member Functions | |
| static bool | dirExists (const std::string &filepath) |
| static bool | fileExists (const std::string &filepath) |
| static std::ifstream | openReadStream (const std::string &filepath) |
| static std::ofstream | openWriteStream (const std::string &filepath) |
| static std::string | parentPath (const std::string &filepath) |
| static void | loadBinaryData (const std::string &filepath, std::vector< char > &out) |
| static std::byte * | loadRGBAImage (const std::string &filepath, uint32 &width, uint32 &height, uint64 &size) |
| static void | destroyImage (std::byte *image) |
| static std::string | getPath (const std::string &filepath) |
Static Public Attributes | |
| static constexpr auto | APP_URI {"app://"} |
|
static |
Frees an image buffer allocated by loadRGBAImage().
| image | Pointer previously returned by loadRGBAImage() (may be nullptr). |
|
static |
Tests whether a directory exists at the given path or URI.
| filepath | URI. |
|
static |
Tests whether a regular file exists at the given path or URI.
| filepath | URI. |
|
static |
Resolves a path or app:// URI to a concrete OS path.
Implementations may expand environment variables, normalize separators, and map app:// to the application data/assets directory.
| filepath | URI. |
|
static |
Loads the entire file contents into a byte buffer.
| filepath | URI. |
| out | Destination buffer; its contents are replaced by the file bytes. |
|
static |
Loads an image and returns an allocated RGBA (8‑bit per channel) buffer.
The caller owns the returned memory and must release it with destroyImage().
| filepath | URI. |
| width | Output image width in pixels. |
| height | Output image height in pixels. |
| size | Output total buffer size in bytes (width*height*4). |
|
static |
Opens an input stream for reading the file at path or URI.
The returned stream is opened in binary mode unless the implementation states otherwise. Callers should check stream.is_open() (or its state) to ensure the file was successfully opened.
| filepath | URI. |
|
static |
Opens an output stream for writing the file at path or URI.
The returned stream is typically opened in binary mode and may create intermediate directories depending on platform support. Callers should check stream.is_open() (or its state) to ensure the file was successfully opened.
| filepath | URI. |
|
static |
Returns the parent directory of the provided path or URI.
For app:// URIs, the parent is computed after resolution. Trailing separators are ignored.
| filepath | URI. |
|
staticconstexpr |
URI scheme used to reference files relative to the application root.