io: add lots of directory and path manipulation functions

This commit is contained in:
2025-04-11 13:54:53 +01:00
parent f3e48f3e47
commit a627116264
10 changed files with 689 additions and 42 deletions

View File

@@ -6,7 +6,9 @@
#include <blue/object/object.h>
#include <stddef.h>
#define B_PATH(p) ((b_path *)p)
#define B_PATH(p) ((b_path *)p)
#define B_RV_PATH(cstr) B_RV(b_path_create_from_str(cstr))
struct b_file_info;
@@ -27,7 +29,13 @@ BLUE_API bool b_path_is_absolute(const b_path *path);
BLUE_API bool b_path_exists(const b_path *path);
BLUE_API bool b_path_is_file(const b_path *path);
BLUE_API bool b_path_is_directory(const b_path *path);
BLUE_API enum b_status b_path_stat(const b_path *path, struct b_file_info *out);
BLUE_API b_status b_path_stat(const b_path *path, struct b_file_info *out);
BLUE_API b_status b_path_unlink(const b_path *path);
BLUE_API enum b_status b_path_get_directory(
const b_path *path, b_path **out_dir_path);
BLUE_API enum b_status b_path_get_filename(
const b_path *path, struct b_string *out_name);
BLUE_API const char *b_path_ptr(const b_path *path);
BLUE_API size_t b_path_length(const b_path *path);