[Base] Make utf8 arguments consistent.
[Base] Make utf8 arguments consistent. Fix "sep" to "separator".
This commit is contained in:
@@ -25,9 +25,9 @@ std::string upper_ascii(const std::string_view view);
|
||||
size_t hash_fnv1a(const std::string_view view);
|
||||
size_t hash_fnv1a_case(const std::string_view view);
|
||||
|
||||
// Splits the given string on any delimiters and returns all parts.
|
||||
std::vector<std::string_view> split(const std::string_view path,
|
||||
const std::string_view delimiters,
|
||||
// Splits the given haystack on any delimiters (needles) and returns all parts.
|
||||
std::vector<std::string_view> split(const std::string_view haystack,
|
||||
const std::string_view needles,
|
||||
bool remove_empty = false);
|
||||
|
||||
bool equal_z(const std::string_view left, const std::string_view right);
|
||||
@@ -66,17 +66,17 @@ std::vector<std::string_view> split_path(const std::string_view path);
|
||||
// Joins two path segments with the given separator.
|
||||
std::string join_paths(const std::string_view left_path,
|
||||
const std::string_view right_path,
|
||||
char32_t sep = kPathSeparator);
|
||||
char32_t separator = kPathSeparator);
|
||||
|
||||
std::string join_paths(std::vector<std::string_view> paths,
|
||||
char32_t sep = kPathSeparator);
|
||||
char32_t separator = kPathSeparator);
|
||||
|
||||
inline std::string join_paths(
|
||||
std::initializer_list<const std::string_view> paths,
|
||||
char32_t sep = kPathSeparator) {
|
||||
char32_t separator = kPathSeparator) {
|
||||
std::string result;
|
||||
for (auto path : paths) {
|
||||
result = join_paths(result, path, sep);
|
||||
result = join_paths(result, path, separator);
|
||||
}
|
||||
return result;
|
||||
}
|
||||
@@ -98,7 +98,7 @@ inline std::string join_guest_paths(
|
||||
// Replaces all path separators with the given value and removes redundant
|
||||
// separators.
|
||||
std::string fix_path_separators(const std::string_view path,
|
||||
char32_t new_sep = kPathSeparator);
|
||||
char32_t new_separator = kPathSeparator);
|
||||
|
||||
inline std::string fix_guest_path_separators(const std::string_view path) {
|
||||
return fix_path_separators(path, kGuestPathSeparator);
|
||||
@@ -106,14 +106,14 @@ inline std::string fix_guest_path_separators(const std::string_view path) {
|
||||
|
||||
// Find the top directory name or filename from a path.
|
||||
std::string find_name_from_path(const std::string_view path,
|
||||
char32_t sep = kPathSeparator);
|
||||
char32_t separator = kPathSeparator);
|
||||
|
||||
inline std::string find_name_from_guest_path(const std::string_view path) {
|
||||
return find_name_from_path(path, kGuestPathSeparator);
|
||||
}
|
||||
|
||||
std::string find_base_name_from_path(const std::string_view path,
|
||||
char32_t sep = kPathSeparator);
|
||||
char32_t separator = kPathSeparator);
|
||||
|
||||
inline std::string find_base_name_from_guest_path(const std::string_view path) {
|
||||
return find_base_name_from_path(path, kGuestPathSeparator);
|
||||
@@ -121,7 +121,7 @@ inline std::string find_base_name_from_guest_path(const std::string_view path) {
|
||||
|
||||
// Get parent path of the given directory or filename.
|
||||
std::string find_base_path(const std::string_view path,
|
||||
char32_t sep = kPathSeparator);
|
||||
char32_t separator = kPathSeparator);
|
||||
|
||||
inline std::string find_base_guest_path(const std::string_view path) {
|
||||
return find_base_path(path, kGuestPathSeparator);
|
||||
@@ -129,7 +129,7 @@ inline std::string find_base_guest_path(const std::string_view path) {
|
||||
|
||||
// Canonicalizes a path, removing ..'s.
|
||||
std::string canonicalize_path(const std::string_view path,
|
||||
char32_t sep = kPathSeparator);
|
||||
char32_t separator = kPathSeparator);
|
||||
|
||||
inline std::string canonicalize_guest_path(const std::string_view path) {
|
||||
return canonicalize_path(path, kGuestPathSeparator);
|
||||
|
||||
Reference in New Issue
Block a user