summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAhmad Samir <a.samirh78@gmail.com>2023-10-01 18:24:22 +0300
committerAhmad Samir <a.samirh78@gmail.com>2023-10-02 23:28:13 +0300
commit42c4d6c249f3627e7106844dbcda0f6e42e542a4 (patch)
tree9e2e3b74dd9e0b7030c226e5d168907957d00971
parent26b279eda19fca85eee70430b8c64b4b8e7904a6 (diff)
String views: de-duplicate API docs
Will be reused in later commits. Change-Id: I078ad7eb0aac6eb389453d8bc32c414c840bc22e Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
-rw-r--r--src/corelib/text/qanystringview.cpp4
-rw-r--r--src/corelib/text/qbytearrayview.qdoc4
-rw-r--r--src/corelib/text/qlatin1stringview.qdoc4
-rw-r--r--src/corelib/text/qstringview.cpp4
-rw-r--r--src/corelib/text/qutf8stringview.qdoc4
5 files changed, 20 insertions, 0 deletions
diff --git a/src/corelib/text/qanystringview.cpp b/src/corelib/text/qanystringview.cpp
index 65655a5e97..89ff248f8d 100644
--- a/src/corelib/text/qanystringview.cpp
+++ b/src/corelib/text/qanystringview.cpp
@@ -440,8 +440,10 @@ QT_BEGIN_NAMESPACE
Returns a string view containing \a n code points of this string view,
starting at position \a pos.
+//! [UB-sliced-index-length]
\note The behavior is undefined when \a pos < 0, \a n < 0,
or \a pos + \a n > size().
+//! [UB-sliced-index-length]
\sa first(), last(), chopped(), chop(), truncate(), {Sizes and Sub-Strings}
*/
@@ -453,7 +455,9 @@ QT_BEGIN_NAMESPACE
Returns a string view starting at position \a pos in this object,
and extending to its end.
+//! [UB-sliced-index-only]
\note The behavior is undefined when \a pos < 0 or \a pos > size().
+//! [UB-sliced-index-only]
\sa first(), last(), chopped(), chop(), truncate(), {Sizes and Sub-Strings}
*/
diff --git a/src/corelib/text/qbytearrayview.qdoc b/src/corelib/text/qbytearrayview.qdoc
index 60c68024b4..9a149a4814 100644
--- a/src/corelib/text/qbytearrayview.qdoc
+++ b/src/corelib/text/qbytearrayview.qdoc
@@ -562,8 +562,10 @@
Returns a byte array view that points to \a n bytes of this byte array
view, starting at position \a pos.
+//! [UB-sliced-index-length]
\note The behavior is undefined when \a pos < 0, \a n < 0,
or \a pos + \a n > size().
+//! [UB-sliced-index-length]
\sa first(), last(), chopped(), chop(), truncate()
*/
@@ -574,7 +576,9 @@
Returns a byte array view starting at position \a pos in this object,
and extending to its end.
+//! [UB-sliced-index-only]
\note The behavior is undefined when \a pos < 0 or \a pos > size().
+//! [UB-sliced-index-only]
\sa first(), last(), chopped(), chop(), truncate()
*/
diff --git a/src/corelib/text/qlatin1stringview.qdoc b/src/corelib/text/qlatin1stringview.qdoc
index 3bd9312232..a39554d344 100644
--- a/src/corelib/text/qlatin1stringview.qdoc
+++ b/src/corelib/text/qlatin1stringview.qdoc
@@ -756,8 +756,10 @@
Returns a Latin-1 string view that points to \a n characters of this
string view, starting at position \a pos.
+//! [UB-sliced-index-length]
\note The behavior is undefined when \a pos < 0, \a n < 0,
or \c{pos + n > size()}.
+//! [UB-sliced-index-length]
\sa first(), last(), chopped(), chop(), truncate()
*/
@@ -769,7 +771,9 @@
Returns a Latin-1 string view starting at position \a pos in this
string view, and extending to its end.
+//! [UB-sliced-index-only]
\note The behavior is undefined when \a pos < 0 or \a pos > size().
+//! [UB-sliced-index-only]
\sa first(), last(), chopped(), chop(), truncate()
*/
diff --git a/src/corelib/text/qstringview.cpp b/src/corelib/text/qstringview.cpp
index 226ab4da9c..6f26a04d34 100644
--- a/src/corelib/text/qstringview.cpp
+++ b/src/corelib/text/qstringview.cpp
@@ -654,8 +654,10 @@ QT_BEGIN_NAMESPACE
Returns a string view that points to \a n characters of this string view,
starting at position \a pos.
+//! [UB-sliced-index-length]
\note The behavior is undefined when \a pos < 0, \a n < 0,
or \a pos + \a n > size().
+//! [UB-sliced-index-length]
\sa first(), last(), chopped(), chop(), truncate()
*/
@@ -668,7 +670,9 @@ QT_BEGIN_NAMESPACE
Returns a string view starting at position \a pos in this object,
and extending to its end.
+//! [UB-sliced-index-only]
\note The behavior is undefined when \a pos < 0 or \a pos > size().
+//! [UB-sliced-index-only]
\sa first(), last(), chopped(), chop(), truncate()
*/
diff --git a/src/corelib/text/qutf8stringview.qdoc b/src/corelib/text/qutf8stringview.qdoc
index 60d0d7cd1d..5f3d7509f7 100644
--- a/src/corelib/text/qutf8stringview.qdoc
+++ b/src/corelib/text/qutf8stringview.qdoc
@@ -605,8 +605,10 @@
Returns a string view containing \a n code points of this string view,
starting at position \a pos.
+//! [UB-sliced-index-length]
\note The behavior is undefined when \a pos < 0, \a n < 0,
or \a pos + \a n > size().
+//! [UB-sliced-index-length]
\sa first(), last(), chopped(), chop(), truncate()
*/
@@ -617,7 +619,9 @@
Returns a string view starting at position \a pos in this object,
and extending to its end.
+//! [UB-sliced-index-only]
\note The behavior is undefined when \a pos < 0 or \a pos > size().
+//! [UB-sliced-index-only]
\sa first(), last(), chopped(), chop(), truncate()
*/