JUCE: AndroidDocumentIterator Class Reference

JUCE

- Main Page
- Related Pages
- Modules
- Classes
- Files

- Class List
- Class Index
- Class Hierarchy
- Class Members

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

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.
AndroidDocumentIterator & | operator++ ()
| 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::copy (AndroidDocumentIterator::makeRecursive (doc),
AndroidDocumentIterator(),
std::back_inserter (children));
return children;
}
AndroidDocumentIterator
An iterator that visits child documents in a directory.
Definition juce_AndroidDocument.h:438
AndroidDocumentIterator::makeNonRecursive
static AndroidDocumentIterator makeNonRecursive(const AndroidDocument &)
Create an iterator that will visit each item in this directory.
AndroidDocumentIterator::makeRecursive
static AndroidDocumentIterator makeRecursive(const AndroidDocument &)
Create an iterator that will visit each item in this directory, and all nested directories.
AndroidDocumentIterator::AndroidDocumentIterator
AndroidDocumentIterator()=default
Creates an end/sentinel iterator.
AndroidDocument
Provides access to a document on Android devices.
Definition juce_AndroidDocument.h:243
String
The JUCE String class!
Definition juce_String.h:54
name
int UnityEventModifiers const char * name
Definition juce_UnityPluginInterface.h:196

## Member Typedef Documentation

## ◆ difference_type

using AndroidDocumentIterator::difference_type = std::ptrdiff_t

## ◆ pointer

using AndroidDocumentIterator::pointer = void

## ◆ 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:

- juce_AndroidDocument.h