![]() |
LibGame v0.4.0
The LG Game Engine - Copyright (C) 2024-2026 ETMSoftware
|
Functions | |
| LG_Path | lg_path (const char *s, lg_path_type t) |
| const char * | lg_path_resolve (const LG_Path *path) |
| LG_Path | lg_path_in_assets_from_fullpath_string (const char *full_path) |
| LG_Path | lg_path_in_wrdir_from_fullpath_string (const char *full_path) |
| LG_Path | lg_path_from_fullpath_string (const char *full_path) |
| lg_path_type | lg_path_get_type_from_fullpath_string (const char *full_path) |
| zboolean | lg_path_string_resolve (char *path) |
| const char * | lg_path_type_get_string (lg_path_type type) |
| zboolean | lg_path_are_equal (const LG_Path *path1, const LG_Path *path2) |
| void | lg_path_info (LG_Path *path) |
| void | lg_resolved_path0_free_buffer () |
=== LG_Path stuff ===
| LG_Path lg_path | ( | const char * | s, |
| lg_path_type | t | ||
| ) |
Create a new LG_Path, ie a path and an associated type, which specify if this path is relative inside the ASSETS folder, or relative inside the APP_WRITABLE folder, or full, or a filename only, or unknown
LG_Path are LOSSLESS, CROSS-APP, AND CROSS-PLATFORM, so you should use them everywhere they are relevant
String max len = LG_PATH_MAX_LEN (see below)
In lg_goodies.h:
Usage example:
| s | String containing the path - if NULL, path is set to an empty string |
| t | Path type, one of IN_ASSETS, IN_APP_WR_DIR, FULL, NAME_ONLY, UNSPECIFIED - if invalid, set to UNSPECIFIED |
| const char * lg_path_resolve | ( | const LG_Path * | path | ) |
Resolve LG_PATH, ie get the full path - at runtime
| path | A LG_Path |
| LG_Path lg_path_in_assets_from_fullpath_string | ( | const char * | full_path | ) |
| LG_Path lg_path_in_wrdir_from_fullpath_string | ( | const char * | full_path | ) |
| LG_Path lg_path_from_fullpath_string | ( | const char * | full_path | ) |
| lg_path_type lg_path_get_type_from_fullpath_string | ( | const char * | full_path | ) |
Return whether a valid full path string points to the ASSETS dir, or the app wr dir, or somewhere else
| full_path | String to full path |
| zboolean lg_path_string_resolve | ( | char * | path | ) |
Resolve a path string (not a path) which includes "../", "./" sequences and extra '/' , making it a valid one
-> doesn't return a full path, unless string is a full path
Change path in place
This func is called internally by lg_path_resolve() but you may use it with any 'writable' string
| path | Path to resolve - will be overwritten |
| const char * lg_path_type_get_string | ( | lg_path_type | type | ) |
Get string from lg_path_type
IN_ASSETS, IN_APP_WR_DIR, FULL, NAME_ONLY, UNSPECIFIED -> 'IN_ASSETS', 'IN_APP_WR_DIR', 'FULL', 'NAME_ONLY', 'UNSPECIFIED'
| type | lg_path_type value |
| void lg_path_info | ( | LG_Path * | path | ) |
| void lg_resolved_path0_free_buffer | ( | ) |
Free resolved_path0 buffer - called by lg_quit(), you should never call this fuction directly