mirror of
https://github.com/lifegpc/c-utils.git
synced 2026-07-08 01:30:39 +08:00
fileop::join now support multiple input
This commit is contained in:
16
fileop.h
16
fileop.h
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user