JUCE-7.0.12-0-g4f43011b96 JUCE-7.0.12-0-g4f43011b96
JUCE — C++ application framework with suport for VST, VST3, LV2 audio plug-ins

« « « Anklang Documentation
Loading...
Searching...
No Matches
juce_RangedDirectoryIterator.h
Go to the documentation of this file.
1 /*
2 ==============================================================================
3
4 This file is part of the JUCE library.
5 Copyright (c) 2022 - Raw Material Software Limited
6
7 JUCE is an open source library subject to commercial or open-source
8 licensing.
9
10 The code included in this file is provided under the terms of the ISC license
11 http://www.isc.org/downloads/software-support-policy/isc-license. Permission
12 To use, copy, modify, and/or distribute this software for any purpose with or
13 without fee is hereby granted provided that the above copyright notice and
14 this permission notice appear in all copies.
15
16 JUCE IS PROVIDED "AS IS" WITHOUT ANY WARRANTY, AND ALL WARRANTIES, WHETHER
17 EXPRESSED OR IMPLIED, INCLUDING MERCHANTABILITY AND FITNESS FOR PURPOSE, ARE
18 DISCLAIMED.
19
20 ==============================================================================
21*/
22
23namespace juce
24{
25
26//==============================================================================
27JUCE_BEGIN_IGNORE_WARNINGS_GCC_LIKE ("-Wdeprecated-declarations")
28JUCE_BEGIN_IGNORE_WARNINGS_MSVC (4996)
29
36{
37public:
39 File getFile() const { return file; }
40
42 Time getModificationTime() const { return modTime; }
43
45 Time getCreationTime() const { return creationTime; }
46
48 int64 getFileSize() const { return fileSize; }
49
51 bool isDirectory() const { return directory; }
52
54 bool isHidden() const { return hidden; }
55
57 bool isReadOnly() const { return readOnly; }
58
62 float getEstimatedProgress() const;
63
64private:
66 File file;
67 Time modTime;
68 Time creationTime;
69 int64 fileSize = 0;
70 bool directory = false;
71 bool hidden = false;
72 bool readOnly = false;
73
74 friend class RangedDirectoryIterator;
75};
76
80inline const DirectoryEntry& operator* (const DirectoryEntry& e) noexcept { return e; }
81
82//==============================================================================
100{
101public:
105 using pointer = void;
107
110
123 RangedDirectoryIterator (const File& directory,
124 bool isRecursive,
125 const String& wildCard = "*",
128
132 bool operator== (const RangedDirectoryIterator& other) const noexcept
133 {
134 return iterator == nullptr && other.iterator == nullptr;
135 }
136
138 bool operator!= (const RangedDirectoryIterator& other) const noexcept
139 {
140 return ! operator== (other);
141 }
142
146 const DirectoryEntry& operator* () const noexcept { return entry; }
147 const DirectoryEntry* operator->() const noexcept { return &entry; }
148
151 {
152 increment();
153 return *this;
154 }
155
162 {
163 auto result = *(*this);
164 ++(*this);
165 return result;
166 }
167
168private:
169 bool next();
170 void increment();
171
173 DirectoryEntry entry;
174};
175
180
185
186
187JUCE_END_IGNORE_WARNINGS_MSVC
188JUCE_END_IGNORE_WARNINGS_GCC_LIKE
189
190} // namespace juce
Describes the attributes of a file or folder.
int64 getFileSize() const
The size of the item.
Time getModificationTime() const
The time at which the item was last modified.
bool isHidden() const
True if the item is hidden, false otherwise.
Time getCreationTime() const
The time at which the item was created.
bool isReadOnly() const
True if the item is read-only, false otherwise.
bool isDirectory() const
True if the item is a directory, false otherwise.
File getFile() const
The path to a file or folder.
Represents a local file or directory.
Definition juce_File.h:45
@ findFiles
Use this flag to indicate that you want to find files.
Definition juce_File.h:566
@ yes
Requests that a file system traversal follow all symbolic links.
Allows iterating over files and folders using C++11 range-for syntax.
RangedDirectoryIterator()=default
The default-constructed iterator acts as the 'end' sentinel.
RangedDirectoryIterator & operator++()
Moves the iterator along to the next file.
bool operator==(const RangedDirectoryIterator &other) const noexcept
Returns true if both iterators are in their end/sentinel state, otherwise returns false.
bool operator!=(const RangedDirectoryIterator &other) const noexcept
Returns the inverse of operator==.
const DirectoryEntry & operator*() const noexcept
Return an object containing metadata about the file or folder to which the iterator is currently poin...
The JUCE String class!
Definition juce_String.h:53
Holds an absolute date and time.
Definition juce_Time.h:37
JUCE Namespace.
const DirectoryEntry & operator*(const DirectoryEntry &e) noexcept
A convenience operator so that the expression *it++ works correctly when it is an instance of RangedD...
RangedDirectoryIterator end(const RangedDirectoryIterator &)
Returns a default-constructed sentinel value.
Type unalignedPointerCast(void *ptr) noexcept
Casts a pointer to another type via void*, which suppresses the cast-align warning which sometimes ar...
Definition juce_Memory.h:88
RangedDirectoryIterator begin(const RangedDirectoryIterator &it)
Returns the iterator that was passed in.
long long int64
A platform-independent 64-bit integer type.