fx.io: expand path joining functionality to non-path strings

This commit is contained in:
2026-06-20 15:25:16 +01:00
parent 32d4d0abf2
commit ee11ff240f
10 changed files with 239 additions and 151 deletions
+4 -4
View File
@@ -205,13 +205,13 @@ bool fx_path_is_absolute(const struct fx_path *path)
bool fx_path_exists(const struct fx_path *path)
{
DWORD attrib = GetFileAttributesA(fx_path_ptr(path));
DWORD attrib = GetFileAttributesA(fx_path_get_cstr(path));
return attrib != INVALID_FILE_ATTRIBUTES;
}
bool fx_path_is_file(const struct fx_path *path)
{
DWORD attrib = GetFileAttributesA(fx_path_ptr(path));
DWORD attrib = GetFileAttributesA(fx_path_get_cstr(path));
if (attrib == INVALID_FILE_ATTRIBUTES) {
return false;
}
@@ -221,7 +221,7 @@ bool fx_path_is_file(const struct fx_path *path)
bool fx_path_is_directory(const struct fx_path *path)
{
DWORD attrib = GetFileAttributesA(fx_path_ptr(path));
DWORD attrib = GetFileAttributesA(fx_path_get_cstr(path));
if (attrib == INVALID_FILE_ATTRIBUTES) {
return false;
}
@@ -229,7 +229,7 @@ bool fx_path_is_directory(const struct fx_path *path)
return (attrib & FILE_ATTRIBUTE_DIRECTORY) != 0;
}
const char *fx_path_ptr(const struct fx_path *path)
const char *fx_path_get_cstr(const struct fx_path *path)
{
return fx_string_get_cstr(path->pathstr);
}