LMMS
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")
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:
65 std::weak_ptr<DirectoryIterator> iterator;
70 bool directory = false;
71 bool hidden = false;
72 bool readOnly = false;
73
75};
76
80inline const DirectoryEntry& operator* (const DirectoryEntry& e) noexcept { return e; }
81
82//==============================================================================
100{
101public:
102 using difference_type = std::ptrdiff_t;
105 using pointer = void;
106 using iterator_category = std::input_iterator_tag;
107
110
123 RangedDirectoryIterator (const File& directory,
124 bool isRecursive,
125 const String& wildCard = "*",
126 int whatToLookFor = File::findFiles,
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; }
148
151 {
152 increment();
153 return *this;
154 }
155
161 DirectoryEntry operator++ (int)
162 {
163 auto result = *(*this);
164 ++(*this);
165 return result;
166 }
167
168private:
169 bool next();
170 void increment();
171
172 std::shared_ptr<DirectoryIterator> iterator;
174};
175
180
185
186
189
190} // namespace juce
#define noexcept
Definition DistrhoDefines.h:72
#define final
Definition DistrhoDefines.h:74
Definition juce_RangedDirectoryIterator.h:36
std::weak_ptr< DirectoryIterator > iterator
Definition juce_RangedDirectoryIterator.h:65
int64 getFileSize() const
Definition juce_RangedDirectoryIterator.h:48
Time getModificationTime() const
Definition juce_RangedDirectoryIterator.h:42
Time modTime
Definition juce_RangedDirectoryIterator.h:67
bool readOnly
Definition juce_RangedDirectoryIterator.h:72
Time creationTime
Definition juce_RangedDirectoryIterator.h:68
File file
Definition juce_RangedDirectoryIterator.h:66
bool hidden
Definition juce_RangedDirectoryIterator.h:71
bool isHidden() const
Definition juce_RangedDirectoryIterator.h:54
Time getCreationTime() const
Definition juce_RangedDirectoryIterator.h:45
int64 fileSize
Definition juce_RangedDirectoryIterator.h:69
bool isReadOnly() const
Definition juce_RangedDirectoryIterator.h:57
bool directory
Definition juce_RangedDirectoryIterator.h:70
friend class RangedDirectoryIterator
Definition juce_RangedDirectoryIterator.h:74
bool isDirectory() const
Definition juce_RangedDirectoryIterator.h:51
File getFile() const
Definition juce_RangedDirectoryIterator.h:39
Definition juce_File.h:45
@ findFiles
Definition juce_File.h:560
FollowSymlinks
Definition juce_File.h:566
@ yes
Definition juce_File.h:579
Definition juce_RangedDirectoryIterator.h:100
void pointer
Definition juce_RangedDirectoryIterator.h:105
const DirectoryEntry * operator->() const noexcept
Definition juce_RangedDirectoryIterator.h:147
std::input_iterator_tag iterator_category
Definition juce_RangedDirectoryIterator.h:106
RangedDirectoryIterator & operator++()
Definition juce_RangedDirectoryIterator.h:150
void increment()
Definition juce_RangedDirectoryIterator.cpp:70
DirectoryEntry reference
Definition juce_RangedDirectoryIterator.h:104
DirectoryEntry value_type
Definition juce_RangedDirectoryIterator.h:103
std::shared_ptr< DirectoryIterator > iterator
Definition juce_RangedDirectoryIterator.h:172
DirectoryEntry entry
Definition juce_RangedDirectoryIterator.h:173
std::ptrdiff_t difference_type
Definition juce_RangedDirectoryIterator.h:102
Definition juce_String.h:53
Definition juce_Time.h:37
* e
Definition inflate.c:1404
#define JUCE_BEGIN_IGNORE_WARNINGS_GCC_LIKE(...)
Definition juce_CompilerWarnings.h:181
#define JUCE_END_IGNORE_WARNINGS_GCC_LIKE
Definition juce_CompilerWarnings.h:182
#define JUCE_BEGIN_IGNORE_WARNINGS_MSVC(warnings)
Definition juce_CompilerWarnings.h:198
#define JUCE_END_IGNORE_WARNINGS_MSVC
Definition juce_CompilerWarnings.h:199
Definition carla_juce.cpp:31
RangedDirectoryIterator end(const RangedDirectoryIterator &)
Definition juce_RangedDirectoryIterator.h:184
long long int64
Definition juce_MathsFunctions.h:54
RangedDirectoryIterator begin(const RangedDirectoryIterator &it)
Definition juce_RangedDirectoryIterator.h:179
int result
Definition process.c:1455
#define void
Definition unzip.h:396
#define const
Definition zconf.h:137