Function in stdx_filesystem.h

x_fs_path_

Build a path from one or more C string components (variadic), writing to out.

X_FILESYSTEM_API bool x_fs_path_(
 XFSPath *out,
 ...
);

Parameters

XFSPath *out
Output path to receive the resulting path.

Returns

True on success, false on failure.

Function in stdx_filesystem.h

x_fs_path_append

Append a single component to a path.

X_FILESYSTEM_API size_t x_fs_path_append(
 XFSPath *p,
 const char *comp
);

Parameters

XFSPath *p
Path to append to.
const char *comp
Component to append.

Returns

New length of the path after appending.

Function in stdx_filesystem.h

x_fs_path_copy

Copies a XFSPath into another XFSPath

X_FILESYSTEM_API size_t x_fs_path_copy(
 const XFSPath *path,
 XFSPath *out
);

Parameters

const XFSPath *path
Path to copy.
XFSPath *out
Where to copy path into.

Returns

size_t size of the copy;

Function in stdx_filesystem.h

x_fs_path_cstr

Get a NUL-terminated C string view of an XFSPath.

X_FILESYSTEM_API const char * x_fs_path_cstr(const XFSPath *p);

Parameters

const XFSPath *p
Path object.

Returns

Pointer to the internal NUL-terminated string.

Function in stdx_filesystem.h

x_fs_path_from_slice

Convert a slice into an XFSPath.

X_FILESYSTEM_API size_t x_fs_path_from_slice(
 XSlice sv,
 XFSPath *out
);

Parameters

XSlice sv
Input slice containing a path string.
XFSPath *out
Output path to receive the converted string.

Returns

Length written to out.

Function in stdx_filesystem.h

x_fs_path_join_slice_

X_FILESYSTEM_API size_t x_fs_path_join_slice_(
 XFSPath *path,
 ...
);
Function in stdx_filesystem.h

x_fs_path_normalize

Normalize a path in-place (e.g., separators, ".", ".." where possible).

X_FILESYSTEM_API XFSPath * x_fs_path_normalize(XFSPath *input);

Parameters

XFSPath *input
Path to normalize.

Returns

Pointer to the normalized path (same as input).

Function in stdx_filesystem.h

x_fs_path_set

Set a path from a C string.

X_FILESYSTEM_API size_t x_fs_path_set(
 XFSPath *p,
 const char *cstr
);

Parameters

XFSPath *p
Path to set.
const char *cstr
Source C string.

Returns

Length written to p.

Function in stdx_filesystem.h

x_fs_path_set_slice

Set a path from a stdx slice.

X_FILESYSTEM_API size_t x_fs_path_set_slice(
 XFSPath *p,
 XSlice slice
);

Parameters

XFSPath *p
Path to set.
XSlice slice
stdx slice string.

Returns

Length written to p.