Function in stdx_filesystem.h

x_fs_directory_parent

Coputes the parent of path and write it into out.

X_FILESYSTEM_API void x_fs_directory_parent(
 const XFSPath *path,
 XFSPath *out
);

Parameters

const XFSPath *path
Path to check compute parent from.
XFSPath *out
Path to write parent into.

Returns

void

Function in stdx_filesystem.h

x_fs_path_basename_cstr

Get the basename (final component) from a path string.

X_FILESYSTEM_API XSlice x_fs_path_basename_cstr(const char *input);

Parameters

const char *input
Path as a C string.

Returns

Slice pointing into input containing the basename.

Function in stdx_filesystem.h

x_fs_path_change_extension

Replace or set the extension of a path.

X_FILESYSTEM_API size_t x_fs_path_change_extension(
 XFSPath *path,
 const char *new_ext
);

Parameters

XFSPath *path
Path to modify.
const char *new_ext
New extension (with or without leading dot, depending on implementation).

Returns

New length of the path after the change.

Function in stdx_filesystem.h

x_fs_path_dirname_cstr

Get the directory name (everything before the final component) from a path string.

X_FILESYSTEM_API XSlice x_fs_path_dirname_cstr(const char *input);

Parameters

const char *input
Path as a C string.

Returns

Slice pointing into input containing the directory portion.

Function in stdx_filesystem.h

x_fs_path_extension_cstr

Get the extension from a path string.

X_FILESYSTEM_API XSlice x_fs_path_extension_cstr(const char *input);

Parameters

const char *input
Path as a C string.

Returns

Slice pointing into input containing the extension (may be empty).

Function in stdx_filesystem.h

x_fs_path_split

Split a path string into components.

X_FILESYSTEM_API bool x_fs_path_split(
 const char *input,
 XFSPath *out_components,
 size_t max_components,
 size_t *out_count
);

Parameters

const char *input
Path as a C string.
XFSPath *out_components
Output array of components.
size_t max_components
Maximum number of components to write.
size_t *out_count
Output count of components written.

Returns

True on success, false on failure.

Function in stdx_filesystem.h

x_fs_path_stem_cstr

Get the filename stem (basename without extension) from a path string.

X_FILESYSTEM_API XSlice x_fs_path_stem_cstr(const char *input);

Parameters

const char *input
Path as a C string.

Returns

Slice pointing into input containing the stem.