mirror of
https://github.com/juce-framework/JUCE.git
synced 2026-01-10 23:44:24 +00:00
RangedDirectoryIterator: Allow querying the estimated progress
This commit is contained in:
parent
6973f850d7
commit
9cc3fca7d0
2 changed files with 15 additions and 0 deletions
|
|
@ -23,6 +23,14 @@
|
|||
namespace juce
|
||||
{
|
||||
|
||||
float DirectoryEntry::getEstimatedProgress() const
|
||||
{
|
||||
if (auto it = iterator.lock())
|
||||
return it->getEstimatedProgress();
|
||||
|
||||
return 0.0f;
|
||||
}
|
||||
|
||||
JUCE_BEGIN_IGNORE_WARNINGS_GCC_LIKE ("-Wdeprecated-declarations")
|
||||
JUCE_BEGIN_IGNORE_WARNINGS_MSVC (4996)
|
||||
|
||||
|
|
@ -37,6 +45,7 @@ RangedDirectoryIterator::RangedDirectoryIterator (const File& directory,
|
|||
wildCard,
|
||||
whatToLookFor))
|
||||
{
|
||||
entry.iterator = iterator;
|
||||
increment();
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -53,7 +53,13 @@ public:
|
|||
/** True if the item is read-only, false otherwise. */
|
||||
bool isReadOnly() const { return readOnly; }
|
||||
|
||||
/** The estimated proportion of the range that has been visited
|
||||
by the iterator, from 0.0 to 1.0.
|
||||
*/
|
||||
float getEstimatedProgress() const;
|
||||
|
||||
private:
|
||||
std::weak_ptr<DirectoryIterator> iterator;
|
||||
File file;
|
||||
Time modTime;
|
||||
Time creationTime;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue