Qt
Internal/Contributor docs for the Qt SDK. Note: These are NOT official API docs; those are found at https://doc.qt.io/
Loading...
Searching...
No Matches
QDirListing::sentinel Class Reference

\typealias QDirListing::const_iterator::reference More...

#include <qdirlisting.h>

+ Collaboration diagram for QDirListing::sentinel:

Friends

constexpr bool operator== (sentinel, sentinel) noexcept
 
constexpr bool operator!= (sentinel, sentinel) noexcept
 

Detailed Description

\typealias QDirListing::const_iterator::reference

\class QDirListing::const_iterator
\since 6.8
\inmodule QtCore
\ingroup  io

The iterator type returned by QDirListing::cbegin().

! [dirlisting-iterator-behavior] \list

  • This is a forward-only, single-pass iterator (you cannot iterate directory entries in reverse order)
  • Can't be copied, only {std::move()}d.
  • post-increment-partially-formed
  • Doesn't allow random access
  • Can be used in ranged-for loops; or with C++20 std::ranges algorithms that don't require random access iterators
  • Dereferencing a valid iterator returns a {const DirEntry &}
  • (c)end() returns a \l QDirListing::sentinel that signals the end of the iteration. Dereferencing an iterator that compares equal to end() is undefined behavior \endlist ! [dirlisting-iterator-behavior]
    \include qdirlisting.cpp ranges-algorithms-note
    
    \sa QDirListing, QDirListing::sentinel, QDirListing::DirEntry
    

A typedef for {const QDirListing::DirEntry &}.

\typealias QDirListing::const_iterator::pointer

A typedef for {const QDirListing::DirEntry *}.

Since
6.8 \inmodule QtCore

\l QDirListing returns an object of this type to signal the end of iteration. Dereferencing a \l QDirListing::const_iterator that is equal to sentinel{} is undefined behavior.

ranges-algorithms-note

See also
QDirListing, QDirListing::const_iterator, QDirListing::DirEntry

Definition at line 98 of file qdirlisting.h.

Friends And Related Symbol Documentation

◆ operator!=

bool operator!= ( sentinel ,
sentinel  )
friend

Definition at line 101 of file qdirlisting.h.

◆ operator==

bool operator== ( sentinel ,
sentinel  )
friend

Definition at line 100 of file qdirlisting.h.


The documentation for this class was generated from the following file: