mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-06-03 00:42:39 +00:00
StringUtil: Make SplitString return by value
Simpler usage.
This commit is contained in:
parent
937d72e591
commit
17ef4c8046
11 changed files with 19 additions and 34 deletions
|
@ -341,15 +341,16 @@ void BuildCompleteFilename(std::string& _CompleteFilename, const std::string& _P
|
|||
_CompleteFilename += _Filename;
|
||||
}
|
||||
|
||||
void SplitString(const std::string& str, const char delim, std::vector<std::string>& output)
|
||||
std::vector<std::string> SplitString(const std::string& str, const char delim)
|
||||
{
|
||||
std::istringstream iss(str);
|
||||
output.resize(1);
|
||||
std::vector<std::string> output(1);
|
||||
|
||||
while (std::getline(iss, *output.rbegin(), delim))
|
||||
output.push_back("");
|
||||
|
||||
output.pop_back();
|
||||
return output;
|
||||
}
|
||||
|
||||
std::string JoinStrings(const std::vector<std::string>& strings, const std::string& delimiter)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue