| 181 | } |
| 182 | |
| 183 | bool OutputStream::writeString (const String& text) |
| 184 | { |
| 185 | auto numBytes = text.getNumBytesAsUTF8() + 1; |
| 186 | |
| 187 | #if (JUCE_STRING_UTF_TYPE == 8) |
| 188 | return write (text.toRawUTF8(), numBytes); |
| 189 | #else |
| 190 | // (This avoids using toUTF8() to prevent the memory bloat that it would leave behind |
| 191 | // if lots of large, persistent strings were to be written to streams). |
| 192 | HeapBlock<char> temp (numBytes); |
| 193 | text.copyToUTF8 (temp, numBytes); |
| 194 | return write (temp, numBytes); |
| 195 | #endif |
| 196 | } |
| 197 | |
| 198 | bool OutputStream::writeText (const String& text, bool asUTF16, bool writeUTF16ByteOrderMark, const char* lf) |
| 199 | { |
no test coverage detected