CX Framework
Cross-platform C utility framework
Loading...
Searching...
No Matches
path.h
Go to the documentation of this file.
1
3
19
20#pragma once
21
22#include <cx/container/sarray.h>
23#include <cx/cx.h>
24
25CX_C_BEGIN
26
46void pathNormalize(_Inout_ string* path);
47
71bool pathDecompose(_Inout_ string* ns, _In_ sa_string* components, _In_opt_ strref path);
72
82bool pathCompose(_Inout_ string* out, _In_opt_ strref ns, _In_ sa_string components);
83
94bool pathIsAbsolute(_In_opt_ strref path);
95
116bool pathParent(_Inout_ string* out, _In_opt_ strref path);
117
134bool pathFilename(_Inout_ string* out, _In_opt_ strref path);
135
153bool pathSplitNS(_Inout_ string* nspart, _Inout_ string* pathpart, _In_opt_ strref path);
154
155bool _pathJoin(_Inout_ string* out, int n, _In_ strref* elements);
156
176#define pathJoin(out, ...) _pathJoin(out, count_macro_args(__VA_ARGS__), (strref[]) { __VA_ARGS__ })
177
193void pathAddExt(_Inout_ string* out, _In_opt_ strref path, _In_opt_ strref ext);
194
210bool pathRemoveExt(_Inout_ string* out, _In_opt_ strref path);
211
227bool pathGetExt(_Inout_ string* out, _In_opt_ strref path);
228
243void pathSetExt(_Inout_ string* out, _In_opt_ strref path, _In_opt_ strref ext);
244
256
282bool pathMatch(_In_opt_ strref path, _In_opt_ strref pattern, uint32 flags);
283
285
286CX_C_END
bool pathFilename(string *out, strref path)
bool pathDecompose(string *ns, sa_string *components, strref path)
bool pathCompose(string *out, strref ns, sa_string components)
bool pathSplitNS(string *nspart, string *pathpart, strref path)
bool pathIsAbsolute(strref path)
void pathNormalize(string *path)
PathMatchFlags
Definition path.h:248
bool pathRemoveExt(string *out, strref path)
bool pathGetExt(string *out, strref path)
void pathSetExt(string *out, strref path, strref ext)
bool pathMatch(strref path, strref pattern, uint32 flags)
void pathAddExt(string *out, strref path, strref ext)
bool pathParent(string *out, strref path)
@ PATH_IgnorePath
Treat slashes as regular characters (not path separators)
Definition path.h:250
@ PATH_LeadingDir
Ignore /* after successful match.
Definition path.h:249
@ PATH_Smart
Definition path.h:251
@ PATH_CaseInsensitive
Perform case-insensitive matching.
Definition path.h:254
Dynamic arrays with type-safe generic programming.