Merge pull request #5536 from sepalani/getstring

HLE: Prevent GetStringVA to strip newlines
This commit is contained in:
shuffle2
2017-06-05 21:31:09 -07:00
committed by GitHub
3 changed files with 16 additions and 3 deletions

View File

@ -405,6 +405,12 @@ bool StringEndsWith(const std::string& str, const std::string& end)
return str.size() >= end.size() && std::equal(end.rbegin(), end.rend(), str.rbegin());
}
void StringPopBackIf(std::string* s, char c)
{
if (!s->empty() && s->back() == c)
s->pop_back();
}
#ifdef _WIN32
std::string UTF16ToUTF8(const std::wstring& input)

View File

@ -119,6 +119,7 @@ std::string ReplaceAll(std::string result, const std::string& src, const std::st
bool StringBeginsWith(const std::string& str, const std::string& begin);
bool StringEndsWith(const std::string& str, const std::string& end);
void StringPopBackIf(std::string* s, char c);
std::string CP1252ToUTF8(const std::string& str);
std::string SHIFTJISToUTF8(const std::string& str);