Loading...
Searching...
No Matches
Public Types | Public Member Functions | Static Public Member Functions | List of all members
AndroidDocumentIterator Class Referencefinal

An iterator that visits child documents in a directory. More...

#include <juce_AndroidDocument.h>

Public Types

using difference_type = std::ptrdiff_t
 
using pointer = void
 
using iterator_category = std::input_iterator_tag
 

Public Member Functions

 AndroidDocumentIterator ()=default
 Creates an end/sentinel iterator.
 
bool operator== (const AndroidDocumentIterator &other) const noexcept
 
bool operator!= (const AndroidDocumentIterator &other) const noexcept
 
AndroidDocument operator* () const
 Returns the document to which this iterator points.
 
AndroidDocumentIteratoroperator++ ()
 Moves this iterator to the next position.
 
AndroidDocumentIterator begin () const
 Allows this iterator to be used directly in a range-for.
 
AndroidDocumentIterator end () const
 Allows this iterator to be used directly in a range-for.
 

Static Public Member Functions

static AndroidDocumentIterator makeNonRecursive (const AndroidDocument &)
 Create an iterator that will visit each item in this directory.
 
static AndroidDocumentIterator makeRecursive (const AndroidDocument &)
 Create an iterator that will visit each item in this directory, and all nested directories.
 

Detailed Description

An iterator that visits child documents in a directory.

Instances of this iterator can be created by calling makeRecursive() or makeNonRecursive(). The results of these functions can additionally be used in standard algorithms, and in range-for loops:

AndroidDocument findFileWithName (const AndroidDocument& parent, const String& name)
{
for (const auto& child : AndroidDocumentIterator::makeNonRecursive (parent))
if (child.getInfo().getName() == name)
return child;
return AndroidDocument();
}
std::vector<AndroidDocument> findAllChildrenRecursive (const AndroidDocument& parent)
{
std::vector<AndroidDocument> children;
std::back_inserter (children));
return children;
}
An iterator that visits child documents in a directory.
Definition juce_AndroidDocument.h:440
static AndroidDocumentIterator makeNonRecursive(const AndroidDocument &)
Create an iterator that will visit each item in this directory.
static AndroidDocumentIterator makeRecursive(const AndroidDocument &)
Create an iterator that will visit each item in this directory, and all nested directories.
AndroidDocumentIterator()=default
Creates an end/sentinel iterator.
Provides access to a document on Android devices.
Definition juce_AndroidDocument.h:245
The JUCE String class!
Definition juce_String.h:56
int UnityEventModifiers const char * name
Definition juce_UnityPluginInterface.h:195

Member Typedef Documentation

◆ difference_type

◆ pointer

◆ iterator_category

using AndroidDocumentIterator::iterator_category = std::input_iterator_tag

Constructor & Destructor Documentation

◆ AndroidDocumentIterator()

AndroidDocumentIterator::AndroidDocumentIterator ( )
default

Creates an end/sentinel iterator.

Member Function Documentation

◆ makeNonRecursive()

static AndroidDocumentIterator AndroidDocumentIterator::makeNonRecursive ( const AndroidDocument & )
static

Create an iterator that will visit each item in this directory.

◆ makeRecursive()

static AndroidDocumentIterator AndroidDocumentIterator::makeRecursive ( const AndroidDocument & )
static

Create an iterator that will visit each item in this directory, and all nested directories.

◆ operator==()

bool AndroidDocumentIterator::operator== ( const AndroidDocumentIterator & other) const
noexcept

Referenced by operator!=().

◆ operator!=()

bool AndroidDocumentIterator::operator!= ( const AndroidDocumentIterator & other) const
noexcept

References operator==().

◆ operator*()

AndroidDocument AndroidDocumentIterator::operator* ( ) const

Returns the document to which this iterator points.

◆ operator++()

AndroidDocumentIterator & AndroidDocumentIterator::operator++ ( )

Moves this iterator to the next position.

◆ begin()

AndroidDocumentIterator AndroidDocumentIterator::begin ( ) const

Allows this iterator to be used directly in a range-for.

◆ end()

AndroidDocumentIterator AndroidDocumentIterator::end ( ) const

Allows this iterator to be used directly in a range-for.


The documentation for this class was generated from the following file:
linkedin facebook pinterest youtube rss twitter instagram facebook-blank rss-blank linkedin-blank pinterest youtube twitter instagram