diff --git a/src/libs/utils/smallstringio.h b/src/libs/utils/smallstringio.h index c8cf70cb273..d3fa5642634 100644 --- a/src/libs/utils/smallstringio.h +++ b/src/libs/utils/smallstringio.h @@ -78,18 +78,27 @@ QDebug &operator<<(QDebug &debug, const SmallString &string) return debug; } -inline -std::ostream &operator<<(std::ostream &stream, const SmallString &string) +template +std::ostream &operator<<(std::ostream &stream, const BasicSmallString &string) { using std::operator<<; return stream << std::string(string.data(), string.size()); } -inline -void PrintTo(const SmallString &string, ::std::ostream *os) +template +void PrintTo(const BasicSmallString &string, ::std::ostream *os) { - *os << "'" << string.data() << "'"; + Utils::SmallString formatedString = string.clone(); + + formatedString.replace("\n", "\\n"); + formatedString.replace("\t", "\\t"); + + *os << "'"; + + os->write(formatedString.data(), formatedString.size()); + + *os<< "'"; } inline QDataStream &operator<<(QDataStream &out, const SmallStringVector &stringVector)