summaryrefslogtreecommitdiffstats
path: root/examples/qtconcurrent/wordcount/main.cpp
diff options
context:
space:
mode:
authorAhmad Samir <a.samirh78@gmail.com>2024-10-25 03:08:38 +0300
committerAhmad Samir <a.samirh78@gmail.com>2025-01-22 19:11:10 +0200
commit3b95bfe7c7b918bfececd9734780aa9e2f91ec02 (patch)
tree4895601647673f940ce2bfd27a52655cd3c2f545 /examples/qtconcurrent/wordcount/main.cpp
parent09fa335fb22122c42f057380e3d6f4d8944256d0 (diff)
QString/QByteArray: add nullTerminate{,d}()
As requested in code review. utf16() guarantees that the string will always be \0-terminated which could mean allocating behind the scenes. On the other hand nullTerminate{,d}() makes it obvious that the data may be deep-copied. For QByteArray, this partially reverts e0206fe9d47bfbf18a0d4c2e5e780504305f72e7. Adding the same method to QByteArray was requested in code review for API symmetry. [ChangeLog][QtCore][QString] Added nullTerminate() and nullTerminated() methods (like chop() and chopped()), which are useful for strings constructed with fromRawData() when calling methods that expect \0-terminated strings. [ChangeLog][QtCore][QByteArray] Added nullTerminate() and nullTerminated() methods, which are useful for byte arrays constructed with fromRawData() when calling methods that expect \0-terminated data. Change-Id: Iec33b889a9ab62460b7a0df8f9b2189f3f794a54 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Diffstat (limited to 'examples/qtconcurrent/wordcount/main.cpp')
0 files changed, 0 insertions, 0 deletions