[Base] Plain string variant of UTF-8 join_paths.
This commit is contained in:
parent
46dfb3449c
commit
b7674f0bd8
|
@ -490,7 +490,20 @@ std::string join_paths(const std::string_view left_path,
|
||||||
return result + std::string(right_path);
|
return result + std::string(right_path);
|
||||||
}
|
}
|
||||||
|
|
||||||
std::string join_paths(std::vector<std::string_view> paths,
|
std::string join_paths(const std::vector<std::string>& paths,
|
||||||
|
char32_t separator) {
|
||||||
|
std::string result;
|
||||||
|
auto it = paths.cbegin();
|
||||||
|
if (it != paths.cend()) {
|
||||||
|
result = *it++;
|
||||||
|
for (; it != paths.cend(); ++it) {
|
||||||
|
result = join_paths(result, *it, separator);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
|
||||||
|
std::string join_paths(const std::vector<std::string_view>& paths,
|
||||||
char32_t separator) {
|
char32_t separator) {
|
||||||
std::string result;
|
std::string result;
|
||||||
auto it = paths.cbegin();
|
auto it = paths.cbegin();
|
||||||
|
|
|
@ -68,7 +68,10 @@ std::string join_paths(const std::string_view left_path,
|
||||||
const std::string_view right_path,
|
const std::string_view right_path,
|
||||||
char32_t separator = kPathSeparator);
|
char32_t separator = kPathSeparator);
|
||||||
|
|
||||||
std::string join_paths(std::vector<std::string_view> paths,
|
std::string join_paths(const std::vector<std::string>& paths,
|
||||||
|
char32_t separator = kPathSeparator);
|
||||||
|
|
||||||
|
std::string join_paths(const std::vector<std::string_view>& paths,
|
||||||
char32_t separator = kPathSeparator);
|
char32_t separator = kPathSeparator);
|
||||||
|
|
||||||
inline std::string join_paths(
|
inline std::string join_paths(
|
||||||
|
@ -86,7 +89,12 @@ inline std::string join_guest_paths(const std::string_view left_path,
|
||||||
return join_paths(left_path, right_path, kGuestPathSeparator);
|
return join_paths(left_path, right_path, kGuestPathSeparator);
|
||||||
}
|
}
|
||||||
|
|
||||||
inline std::string join_guest_paths(std::vector<std::string_view> paths) {
|
inline std::string join_guest_paths(const std::vector<std::string>& paths) {
|
||||||
|
return join_paths(paths, kGuestPathSeparator);
|
||||||
|
}
|
||||||
|
|
||||||
|
inline std::string join_guest_paths(
|
||||||
|
const std::vector<std::string_view>& paths) {
|
||||||
return join_paths(paths, kGuestPathSeparator);
|
return join_paths(paths, kGuestPathSeparator);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue