src/bytestream.cpp

changeset 15
3d3e5f0fc4cc
parent 13
9bdddd2ccde6
child 17
b41d74bacdea
equal deleted inserted replaced
14:825d9ed1ee01 15:3d3e5f0fc4cc
208 208
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());
216 #else
214 doWrite (c.toAscii()); 217 doWrite (c.toAscii());
218 #endif // QT_VERSION
215 219
216 doWrite ('\0'); 220 doWrite ('\0');
217 } 221 }
218 222
219 // ============================================================================= 223 // =============================================================================

mercurial