added path_fix_separators

This commit is contained in:
2026-06-07 21:55:13 +05:00
parent 82a6293f21
commit efa4a24304
5 changed files with 19 additions and 1 deletions

View File

@@ -31,6 +31,9 @@
#define path_notseps "\\"
#endif
// @brief replaces path_notsep with path_sep
void path_fix_separators(str* path);
/// @brief removes part of path after path_sep (including path_sep)
/// @return pointer to a segment of path.data or "." if no path_sep has been found
str path_dirname(str path);

View File

@@ -90,6 +90,10 @@ str hex_to_str(Array(u8) buf, bool uppercase);
void str_trim(str* line, bool set_zero_at_end);
/// replaces all occurences of `fragment` in `s` with `replacement`
void str_replaceChar(str* s, char fragment, char replacement);
///@return s[0..n]
static inline str str_sliceBefore(str s, u32 n){
return str_construct(s.data, n, false);