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_core
files
juce_RangedDirectoryIterator.cpp
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
23
namespace
juce
24
{
25
26
JUCE_BEGIN_IGNORE_WARNINGS_GCC_LIKE (
"-Wdeprecated-declarations"
)
27
JUCE_BEGIN_IGNORE_WARNINGS_MSVC (4996)
28
29
float
DirectoryEntry
::getEstimatedProgress()
const
30
{
31
if
(
auto
it
= iterator.lock())
32
return
it
->
getEstimatedProgress
();
33
34
return
0.0f;
35
}
36
37
// We implement this in terms of the deprecated DirectoryIterator,
38
// but the old DirectoryIterator might go away in the future!
39
RangedDirectoryIterator::RangedDirectoryIterator
(
const
File
& directory,
40
bool
isRecursive,
41
const
String
& wildCard,
42
int
whatToLookFor
,
43
File::FollowSymlinks
followSymlinks
)
44
: iterator (new DirectoryIterator (directory,
45
isRecursive,
46
wildCard,
47
whatToLookFor
,
48
followSymlinks
))
49
{
50
entry.iterator = iterator;
51
increment();
52
}
53
54
bool
RangedDirectoryIterator::next()
55
{
56
const
auto
result = iterator->next (&entry.directory,
57
&entry.hidden,
58
&entry.fileSize,
59
&entry.modTime,
60
&entry.creationTime,
61
&entry.readOnly);
62
if
(result)
63
entry.file = iterator->getFile();
64
else
65
entry = {};
66
67
return
result;
68
}
69
70
void
RangedDirectoryIterator::increment()
71
{
72
if
(iterator !=
nullptr
&& ! next())
73
iterator =
nullptr
;
74
}
75
76
JUCE_END_IGNORE_WARNINGS_GCC_LIKE
77
JUCE_END_IGNORE_WARNINGS_MSVC
78
79
}
// namespace juce
juce::DirectoryEntry
Describes the attributes of a file or folder.
Definition
juce_RangedDirectoryIterator.h:36
juce::DirectoryEntry::getEstimatedProgress
float getEstimatedProgress() const
The estimated proportion of the range that has been visited by the iterator, from 0....
Definition
juce_RangedDirectoryIterator.cpp:29
juce::File
Represents a local file or directory.
Definition
juce_File.h:45
juce::File::FollowSymlinks
FollowSymlinks
Definition
juce_File.h:572
juce::RangedDirectoryIterator::RangedDirectoryIterator
RangedDirectoryIterator()=default
The default-constructed iterator acts as the 'end' sentinel.
juce::String
The JUCE String class!
Definition
juce_String.h:53
juce
JUCE Namespace.
Definition
juce_AudioPlayHead.cpp:24
juce::unalignedPointerCast
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
« « « Anklang Documentation