Utils: Fix small string ostream operator <<

It was used for test printing so we could see '\n' printed. I have to find
a better way todo it only for tests.

Task-number: QDS-2459
Change-Id: I10b38645bfdb8160cb9aeccd62c50a81fe953345
Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
This commit is contained in:
Marco Bubke
2020-07-02 09:10:24 +02:00
parent 7252505879
commit 8f8c817294

View File

@@ -78,12 +78,7 @@ QDebug &operator<<(QDebug &debug, const String &string)
template <uint Size> template <uint Size>
std::ostream &operator<<(std::ostream &out, const BasicSmallString<Size> &string) std::ostream &operator<<(std::ostream &out, const BasicSmallString<Size> &string)
{ {
BasicSmallString<Size> formatedString = string.clone(); out.write(string.data(), std::streamsize(string.size()));
formatedString.replace("\n", "\\n");
formatedString.replace("\t", "\\t");
out.write(formatedString.data(), std::streamsize(formatedString.size()));
return out; return out;
} }