openshot-audio  0.1.6
juce_DirectoryIterator.h
Go to the documentation of this file.
1 /*
2  ==============================================================================
3 
4  This file is part of the juce_core module of the JUCE library.
5  Copyright (c) 2015 - ROLI Ltd.
6 
7  Permission to use, copy, modify, and/or distribute this software for any purpose with
8  or without fee is hereby granted, provided that the above copyright notice and this
9  permission notice appear in all copies.
10 
11  THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD
12  TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN
13  NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL
14  DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER
15  IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN
16  CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
17 
18  ------------------------------------------------------------------------------
19 
20  NOTE! This permissive ISC license applies ONLY to files within the juce_core module!
21  All other JUCE modules are covered by a dual GPL/commercial license, so if you are
22  using any other modules, be sure to check that you also comply with their license.
23 
24  For more details, visit www.juce.com
25 
26  ==============================================================================
27 */
28 
29 #ifndef JUCE_DIRECTORYITERATOR_H_INCLUDED
30 #define JUCE_DIRECTORYITERATOR_H_INCLUDED
31 
32 
33 //==============================================================================
47 {
48 public:
49  //==============================================================================
72  DirectoryIterator (const File& directory,
73  bool isRecursive,
74  const String& wildCard = "*",
75  int whatToLookFor = File::findFiles);
76 
79 
85  bool next();
86 
99  bool next (bool* isDirectory,
100  bool* isHidden,
101  int64* fileSize,
102  Time* modTime,
103  Time* creationTime,
104  bool* isReadOnly);
105 
110  const File& getFile() const;
111 
117  float getEstimatedProgress() const;
118 
119 private:
120  //==============================================================================
121  class NativeIterator
122  {
123  public:
124  NativeIterator (const File& directory, const String& wildCard);
125  ~NativeIterator();
126 
127  bool next (String& filenameFound,
128  bool* isDirectory, bool* isHidden, int64* fileSize,
129  Time* modTime, Time* creationTime, bool* isReadOnly);
130 
131  class Pimpl;
132 
133  private:
134  friend class DirectoryIterator;
135  friend struct ContainerDeletePolicy<Pimpl>;
136  ScopedPointer<Pimpl> pimpl;
137 
139  };
140 
141  friend struct ContainerDeletePolicy<NativeIterator::Pimpl>;
142  StringArray wildCards;
143  NativeIterator fileFinder;
144  String wildCard, path;
145  int index;
146  mutable int totalNumFiles;
147  const int whatToLookFor;
148  const bool isRecursive;
149  bool hasBeenAdvanced;
150  ScopedPointer<DirectoryIterator> subIterator;
151  File currentFile;
152 
153  static StringArray parseWildcards (const String& pattern);
154  static bool fileMatches (const StringArray& wildCards, const String& filename);
155 
157 };
158 
159 #endif // JUCE_DIRECTORYITERATOR_H_INCLUDED
Definition: juce_File.h:534
Definition: juce_Time.h:41
Definition: juce_String.h:43
#define JUCE_API
Definition: juce_StandardHeader.h:139
#define const
Definition: juce_DirectoryIterator.h:46
Definition: juce_ScopedPointer.h:70
long long int64
Definition: juce_MathsFunctions.h:60
Definition: juce_win32_Windowing.cpp:76
Definition: juce_StringArray.h:39
Definition: juce_ContainerDeletePolicy.h:44
#define JUCE_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR(className)
Definition: juce_PlatformDefs.h:198
Definition: juce_File.h:45