diff options
author | Samuel Gaist <samuel.gaist@edeltech.ch> | 2014-02-28 23:48:24 +0100 |
---|---|---|
committer | The Qt Project <gerrit-noreply@qt-project.org> | 2014-03-08 00:21:53 +0100 |
commit | be81c5884549c3b97ade6e7b97cf75a076d70424 (patch) | |
tree | 578997ce6e1f63ff6d23a2b163772bab9e15b9aa /src/corelib/tools/qbytearray.cpp | |
parent | 7625c51ef426b73a8bda5853a4bd2e2d9d3aeb55 (diff) |
Add Objective-C specific type converters to QByteArray
This patch adds the Objective-C NSData/CDataRef converters to
QByteArray
This will replace the current converters offered in QMacExtras
[ChangeLog][QtCore][Objective-C] Added NSData/CDataRef converters for
QByteArray
Change-Id: I7a0f14bee4271798db345f3c5efd26ac671a3ea4
Reviewed-by: Jake Petroules <jake.petroules@petroules.com>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Diffstat (limited to 'src/corelib/tools/qbytearray.cpp')
-rw-r--r-- | src/corelib/tools/qbytearray.cpp | 85 |
1 files changed, 85 insertions, 0 deletions
diff --git a/src/corelib/tools/qbytearray.cpp b/src/corelib/tools/qbytearray.cpp index 73fd6369a7..fb92d82f07 100644 --- a/src/corelib/tools/qbytearray.cpp +++ b/src/corelib/tools/qbytearray.cpp @@ -4186,6 +4186,91 @@ QByteArray QByteArray::fromPercentEncoding(const QByteArray &input, char percent return tmp; } +/*! \fn QByteArray QByteArray::fromCFData(CFDataRef data) + \since 5.3 + + Constructs a new QByteArray containing a copy of the CFData \a data. + + \sa fromRawCFData(), fromRawData(), toRawCFData(), toCFData() +*/ + +/*! \fn QByteArray QByteArray::fromRawCFData(CFDataRef data) + \since 5.3 + + Constructs a QByteArray that uses the bytes of the CFData \a data. + + The \a data's bytes are not copied. + + The caller guarantees that the CFData will not be deleted + or modified as long as this QByteArray object exists. + + \sa fromCFData(), fromRawData(), toRawCFData(), toCFData() +*/ + +/*! \fn CFDataRef QByteArray::toCFData() const + \since 5.3 + + Creates a CFData from a QByteArray. The caller owns the CFData object + and is responsible for releasing it. + + \sa toRawCFData(), fromCFData(), fromRawCFData(), fromRawData() +*/ + +/*! \fn CFDataRef QByteArray::toRawCFData() const + \since 5.3 + + Constructs a CFData that uses the bytes of the QByteArray. + + The QByteArray's bytes are not copied. + + The caller guarantees that the QByteArray will not be deleted + or modified as long as this CFData object exists. + + \sa toCFData(), fromRawCFData(), fromCFData(), fromRawData() +*/ + +/*! \fn QByteArray QByteArray::fromNSData(const NSData *data) + \since 5.3 + + Constructs a new QByteArray containing a copy of the NSData \a data. + + \sa fromRawNSData(), fromRawData(), toNSData(), toRawNSData() +*/ + +/*! \fn QByteArray QByteArray::fromRawNSData(const NSData *data) + \since 5.3 + + Constructs a QByteArray that uses the bytes of the NSData \a data. + + The \a data's bytes are not copied. + + The caller guarantees that the NSData will not be deleted + or modified as long as this QByteArray object exists. + + \sa fromNSData(), fromRawData(), toRawNSData(), toNSData() +*/ + +/*! \fn NSData QByteArray::toNSData() const + \since 5.3 + + Creates a NSData from a QByteArray. The NSData object is autoreleased. + + \sa fromNSData(), fromRawNSData(), fromRawData(), toRawNSData() +*/ + +/*! \fn NSData QByteArray::toRawNSData() const + \since 5.3 + + Constructs a NSData that uses the bytes of the QByteArray. + + The QByteArray's bytes are not copied. + + The caller guarantees that the QByteArray will not be deleted + or modified as long as this NSData object exists. + + \sa fromRawNSData(), fromNSData(), fromRawData(), toNSData() +*/ + static inline bool q_strchr(const char str[], char chr) { if (!str) return false; |