utils: split: Rename all splitBy*() variants to split()
这个提交包含在:
@@ -78,7 +78,7 @@ std::string utils::urldecode(std::string_view str)
|
||||
return result;
|
||||
}
|
||||
|
||||
std::vector<std::string> utils::splitByChar(const std::string &str, char delim)
|
||||
std::vector<std::string> utils::split(const std::string &str, char delim)
|
||||
{
|
||||
std::vector<std::string> result;
|
||||
std::stringstream stream(str);
|
||||
@@ -91,12 +91,13 @@ std::vector<std::string> utils::splitByChar(const std::string &str, char delim)
|
||||
}
|
||||
|
||||
// TODO: can easily break if we pass a regex here
|
||||
std::vector<std::string> utils::splitByString(const std::string &str, const std::string &delim)
|
||||
std::vector<std::string> utils::split(const std::string &str, const std::string &delim)
|
||||
{
|
||||
return splitByRegex(str, delim + "+");
|
||||
std::regex regex { delim + "+" };
|
||||
return split(str, regex);
|
||||
}
|
||||
|
||||
std::vector<std::string> utils::splitByRegex(const std::string &str, const std::string ®ex)
|
||||
std::vector<std::string> utils::split(const std::string &str, std::regex ®ex)
|
||||
{
|
||||
std::vector<std::string> result;
|
||||
std::regex reg(regex);
|
||||
|
||||
在新工单中引用
屏蔽一个用户