summaryrefslogtreecommitdiffstats
path: root/src/corelib/tools/qbytearray.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/corelib/tools/qbytearray.cpp')
-rw-r--r--src/corelib/tools/qbytearray.cpp24
1 files changed, 23 insertions, 1 deletions
diff --git a/src/corelib/tools/qbytearray.cpp b/src/corelib/tools/qbytearray.cpp
index 556093f..c5f70b0 100644
--- a/src/corelib/tools/qbytearray.cpp
+++ b/src/corelib/tools/qbytearray.cpp
@@ -154,6 +154,10 @@ char *qstrcpy(char *dst, const char *src)
This function assumes that \a dst is at least \a len characters
long.
+ \note When compiling with Visual C++ compiler version 14.00
+ (Visual C++ 2005) or later, internally the function strncpy_s
+ will be used.
+
\sa qstrcpy()
*/
@@ -1061,6 +1065,11 @@ QByteArray &QByteArray::operator=(const char *str)
\internal
*/
+/*! \fn bool QByteArray::isSharedWith(const QByteArray &other) const
+
+ \internal
+*/
+
/*! \fn char QByteArray::at(int i) const
Returns the character at index position \a i in the byte array.
@@ -1799,7 +1808,20 @@ QByteArray &QByteArray::replace(int pos, int len, const QByteArray &after)
*/
QByteArray &QByteArray::replace(int pos, int len, const char *after)
{
- int alen = qstrlen(after);
+ return replace(pos,len,after,qstrlen(after));
+}
+
+/*! \fn QByteArray &QByteArray::replace(int pos, int len, const char *after, int alen)
+
+ \overload
+
+ Replaces \a len bytes from index position \a pos with \a alen bytes
+ from the string \a after. \a after is allowed to have '\0' characters.
+
+ \since 4.7
+*/
+QByteArray &QByteArray::replace(int pos, int len, const char *after, int alen)
+{
if (len == alen && (pos + len <= d->size)) {
detach();
memcpy(d->data + pos, after, len*sizeof(char));