fileop::join now support multiple input

This commit is contained in:
2025-05-17 13:23:52 +08:00
parent 2480b6ea8a
commit f4213c702c
2 changed files with 28 additions and 0 deletions

View File

@@ -69,6 +69,22 @@ namespace fileop {
* @return result
*/
std::string join(std::string path, std::string path2);
/**
* @brief Join multiple pathname components
* @param paths List of pathname components
* @return Joined path string
*/
std::string join(std::initializer_list<std::string> paths);
/**
* @brief Join multiple pathname components (variadic template version)
* @tparam Args Additional pathname component types
* @param paths All pathname components
* @return Joined path string
*/
template<typename... Args>
std::string join(Args... paths) {
return join({std::forward<Args>(paths)...});
}
/**
* @brief check if path is an existing directory.
* @param path Path