From 604a8c7acc4351a48b362349cfa7f85006673c47 Mon Sep 17 00:00:00 2001 From: Andreas Buhr Date: Thu, 3 Dec 2020 14:02:58 +0100 Subject: Fix documentation of QStringTokenizer Documentation of QStringTokenizer was broken, mainly because most parts of the interface were defined in base classes. This patch gets those members into QStringTokenizer itself in order to document them. Task-number: QTBUG-88533 Pick-to: 6.0 Change-Id: Id00a79db4b293958a9c5ed53a518a97721d228c0 Reviewed-by: Volker Hilsheimer --- src/corelib/text/qstringtokenizer.cpp | 22 +++++++++++----------- src/corelib/text/qstringtokenizer.h | 18 +++++++++++++++++- 2 files changed, 28 insertions(+), 12 deletions(-) diff --git a/src/corelib/text/qstringtokenizer.cpp b/src/corelib/text/qstringtokenizer.cpp index 44999425ae..cad70c6718 100644 --- a/src/corelib/text/qstringtokenizer.cpp +++ b/src/corelib/text/qstringtokenizer.cpp @@ -147,26 +147,26 @@ QT_BEGIN_NAMESPACE */ /*! - \typedef template QStringTokenizer::value_type + \typealias QStringTokenizer::value_type Alias for \c{const QStringView} or \c{const QLatin1String}, depending on the tokenizer's \c Haystack template argument. */ /*! - \typedef template QStringTokenizer::difference_type + \typealias QStringTokenizer::difference_type Alias for qsizetype. */ /*! - \typedef template QStringTokenizer::size_type + \typealias QStringTokenizer::size_type Alias for qsizetype. */ /*! - \typedef template QStringTokenizer::reference + \typealias QStringTokenizer::reference Alias for \c{value_type &}. @@ -175,13 +175,13 @@ QT_BEGIN_NAMESPACE */ /*! - \typedef template QStringTokenizer::const_reference + \typealias QStringTokenizer::const_reference Alias for \c{value_type &}. */ /*! - \typedef template QStringTokenizer::pointer + \typealias QStringTokenizer::pointer Alias for \c{value_type *}. @@ -190,13 +190,13 @@ QT_BEGIN_NAMESPACE */ /*! - \typedef template QStringTokenizer::const_pointer + \typealias QStringTokenizer::const_pointer Alias for \c{value_type *}. */ /*! - \typedef template QStringTokenizer::iterator + \typealias QStringTokenizer::iterator This typedef provides an STL-style const iterator for QStringTokenizer. @@ -208,7 +208,7 @@ QT_BEGIN_NAMESPACE */ /*! - \typedef template QStringTokenizer::const_iterator + \typedef QStringTokenizer::const_iterator This typedef provides an STL-style const iterator for QStringTokenizer. @@ -217,7 +217,7 @@ QT_BEGIN_NAMESPACE */ /*! - \typedef template QStringTokenizer::sentinel + \typealias QStringTokenizer::sentinel This typedef provides an STL-style sentinel for QStringTokenizer::iterator and QStringTokenizer::const_iterator. @@ -251,7 +251,7 @@ QT_BEGIN_NAMESPACE Returns a const \l{STL-style iterators}{STL-style iterator} pointing to the first token in the list. - \sa end(), cbegin() + \sa end(), cend() */ /*! diff --git a/src/corelib/text/qstringtokenizer.h b/src/corelib/text/qstringtokenizer.h index 76d8015159..796ba1d810 100644 --- a/src/corelib/text/qstringtokenizer.h +++ b/src/corelib/text/qstringtokenizer.h @@ -301,7 +301,23 @@ class QStringTokenizer bool >::type; public: - using value_type = typename Base::value_type; + using value_type = typename Base::value_type; + using difference_type = typename Base::difference_type; + using size_type = typename Base::size_type; + using reference = typename Base::reference; + using const_reference = typename Base::const_reference; + using pointer = typename Base::pointer; + using const_pointer = typename Base::const_pointer; + using iterator = typename Base::iterator; + using const_iterator = typename Base::const_iterator; + using sentinel = typename Base::sentinel; + +#ifdef Q_QDOC + [[nodiscard]] iterator begin() const noexcept { return Base::begin(); } + [[nodiscard]] iterator cbegin() const noexcept { return begin(); } + [[nodiscard]] constexpr sentinel end() const noexcept { return {}; } + [[nodiscard]] constexpr sentinel cend() const noexcept { return {}; } +#endif constexpr explicit QStringTokenizer(Haystack haystack, Needle needle, Qt::CaseSensitivity cs, -- cgit v1.2.3