209 // ============================================================================= |
209 // ============================================================================= |
210 void Bytestream::writeString (str val) { |
210 void Bytestream::writeString (str val) { |
211 growToFit (val.length() + 1); |
211 growToFit (val.length() + 1); |
212 |
212 |
213 for (qchar c : val) |
213 for (qchar c : val) |
214 #if (QT_VERSION >= QT_VERSION_CHECK (5, 0, 0)) |
|
215 doWrite (c.toLatin1()); |
214 doWrite (c.toLatin1()); |
216 #else |
|
217 doWrite (c.toAscii()); |
|
218 #endif // QT_VERSION |
|
219 |
215 |
220 doWrite ('\0'); |
216 doWrite ('\0'); |
221 } |
217 } |
222 |
218 |
223 // ============================================================================= |
219 // ============================================================================= |