Engine getting complicated - need some JSON for troubleshooting.
This commit is contained in:
parent
350c20efa6
commit
30e30c8a7b
3 changed files with 70 additions and 9 deletions
|
@ -121,3 +121,22 @@ std::string StringUtils::ToPaddedString(unsigned numBytes, unsigned entry)
|
|||
sstr << std::setfill('0') << std::setw(numBytes) << entry;
|
||||
return sstr.str();
|
||||
}
|
||||
|
||||
std::string StringUtils::stripQuotes(const std::string& input)
|
||||
{
|
||||
if (input.size() < 3)
|
||||
{
|
||||
return input;
|
||||
}
|
||||
std::size_t start_index = 0;
|
||||
std::size_t end_index = input.size()-1;
|
||||
if (input[start_index] == '"')
|
||||
{
|
||||
start_index = 1;
|
||||
}
|
||||
if (input[end_index] == '"')
|
||||
{
|
||||
end_index = end_index - 1;
|
||||
}
|
||||
return input.substr(start_index, end_index - start_index + 1);
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue