Engine getting complicated - need some JSON for troubleshooting.

This commit is contained in:
jmsgrogan 2022-10-21 08:28:32 +01:00
parent 350c20efa6
commit 30e30c8a7b
3 changed files with 70 additions and 9 deletions

View file

@ -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);
}