2021-06-30 12:02:46 +00:00
|
|
|
#pragma once
|
2021-08-19 00:18:42 +00:00
|
|
|
|
|
|
|
#include <m-string.h>
|
2021-06-30 12:02:46 +00:00
|
|
|
|
|
|
|
#ifdef __cplusplus
|
|
|
|
extern "C" {
|
|
|
|
#endif
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @brief Extract filename without extension from path.
|
|
|
|
*
|
|
|
|
* @param path path string
|
|
|
|
* @param filename output filename string. Must be initialized before.
|
|
|
|
*/
|
|
|
|
void path_extract_filename_no_ext(const char* path, string_t filename);
|
|
|
|
|
2022-04-13 20:50:25 +00:00
|
|
|
/**
|
|
|
|
* @brief Extract last path component
|
|
|
|
*
|
|
|
|
* @param path path string
|
|
|
|
* @param filename output string. Must be initialized before.
|
|
|
|
*/
|
|
|
|
void path_extract_basename(const char* path, string_t basename);
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @brief Extract path, except for last component
|
|
|
|
*
|
|
|
|
* @param path path string
|
|
|
|
* @param filename output string. Must be initialized before.
|
|
|
|
*/
|
|
|
|
void path_extract_dirname(const char* path, string_t dirname);
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @brief Appends new component to path, adding path delimiter
|
|
|
|
*
|
|
|
|
* @param path path string
|
|
|
|
* @param suffix path part to apply
|
|
|
|
*/
|
|
|
|
void path_append(string_t path, const char* suffix);
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @brief Appends new component to path, adding path delimiter
|
|
|
|
*
|
|
|
|
* @param path first path part
|
|
|
|
* @param suffix second path part
|
|
|
|
* @param out_path output string to combine parts into. Must be initialized
|
|
|
|
*/
|
|
|
|
void path_concat(const char* path, const char* suffix, string_t out_path);
|
|
|
|
|
2021-06-30 12:02:46 +00:00
|
|
|
#ifdef __cplusplus
|
|
|
|
}
|
2022-04-13 20:50:25 +00:00
|
|
|
#endif
|