LMMS
Loading...
Searching...
No Matches
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
23namespace juce
24{
25
26JUCE_BEGIN_IGNORE_WARNINGS_GCC_LIKE ("-Wdeprecated-declarations")
28
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!
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
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
71{
72 if (iterator != nullptr && ! next())
73 iterator = nullptr;
74}
75
78
79} // namespace juce
Definition juce_RangedDirectoryIterator.h:36
std::weak_ptr< DirectoryIterator > iterator
Definition juce_RangedDirectoryIterator.h:65
float getEstimatedProgress() const
Definition juce_RangedDirectoryIterator.cpp:29
Definition juce_DirectoryIterator.h:56
Definition juce_File.h:45
FollowSymlinks
Definition juce_File.h:566
void increment()
Definition juce_RangedDirectoryIterator.cpp:70
bool next()
Definition juce_RangedDirectoryIterator.cpp:54
std::shared_ptr< DirectoryIterator > iterator
Definition juce_RangedDirectoryIterator.h:172
DirectoryEntry entry
Definition juce_RangedDirectoryIterator.h:173
Definition juce_String.h:53
#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
int result
Definition process.c:1455