mirror of
https://github.com/shadps4-emu/shadPS4.git
synced 2025-05-30 23:33:17 +00:00
more progress on symbols decoding
This commit is contained in:
parent
cae39ccf23
commit
f333098231
4 changed files with 91 additions and 2 deletions
26
src/Util/StringUtil.h
Normal file
26
src/Util/StringUtil.h
Normal file
|
@ -0,0 +1,26 @@
|
|||
#pragma once
|
||||
#include <vector>
|
||||
#include <string>
|
||||
|
||||
namespace StringUtil {
|
||||
|
||||
static std::vector<std::string> split(const std::string& s, char seperator)
|
||||
{
|
||||
std::vector<std::string> output;
|
||||
|
||||
std::string::size_type prev_pos = 0, pos = 0;
|
||||
|
||||
while ((pos = s.find(seperator, pos)) != std::string::npos)
|
||||
{
|
||||
std::string substring(s.substr(prev_pos, pos - prev_pos));
|
||||
|
||||
output.push_back(substring);
|
||||
|
||||
prev_pos = ++pos;
|
||||
}
|
||||
|
||||
output.push_back(s.substr(prev_pos, pos - prev_pos)); // Last word
|
||||
|
||||
return output;
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue