fx.io: expand path joining functionality to non-path strings
This commit is contained in:
@@ -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);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user