JUCE: AndroidDocumentIterator Class Reference

JUCE

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. More...
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. More...
AndroidDocumentIterator & | operator++ ()
| Moves this iterator to the next position. More...
AndroidDocumentIterator | begin () const
| Allows this iterator to be used directly in a range-for. More...
AndroidDocumentIterator | end () const
| Allows this iterator to be used directly in a range-for. More...

## Static Public Member Functions
static AndroidDocumentIterator | makeNonRecursive (const AndroidDocument &)
| Create an iterator that will visit each item in this directory. More...
static AndroidDocumentIterator | makeRecursive (const AndroidDocument &)
| Create an iterator that will visit each item in this directory, and all nested directories. More...

## 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::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
StandardApplicationCommandIDs::copy
@ copy
The command ID that should be used to send a "Copy to clipboard" command.
Definition: juce_ApplicationCommandID.h:72
gl::name
GLuint const GLchar * name
Definition: juce_gl.h:1565

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