OpenShot Audio Library | OpenShotAudio  0.3.0
juce_FileSearchPath.h
1 /*
2  ==============================================================================
3 
4  This file is part of the JUCE library.
5  Copyright (c) 2017 - ROLI Ltd.
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 //==============================================================================
34 class JUCE_API FileSearchPath
35 {
36 public:
37  //==============================================================================
40 
48  FileSearchPath (const String& path);
49 
52 
54  FileSearchPath& operator= (const FileSearchPath&);
55 
57  ~FileSearchPath();
58 
64  FileSearchPath& operator= (const String& path);
65 
66  //==============================================================================
70  int getNumPaths() const;
71 
76  File operator[] (int index) const;
77 
79  String toString() const;
80 
81  //==============================================================================
87  void add (const File& directoryToAdd,
88  int insertIndex = -1);
89 
94  bool addIfNotAlreadyThere (const File& directoryToAdd);
95 
97  void remove (int indexToRemove);
98 
102  void addPath (const FileSearchPath&);
103 
111  void removeRedundantPaths();
112 
114  void removeNonExistentPaths();
115 
116  //==============================================================================
129  Array<File> findChildFiles (int whatToLookFor,
130  bool searchRecursively,
131  const String& wildCardPattern = "*") const;
132 
138  int findChildFiles (Array<File>& results,
139  int whatToLookFor,
140  bool searchRecursively,
141  const String& wildCardPattern = "*") const;
142 
143  //==============================================================================
159  bool isFileInPath (const File& fileToCheck,
160  bool checkRecursively) const;
161 
162 private:
163  //==============================================================================
164  StringArray directories;
165 
166  void init (const String&);
167 
168  JUCE_LEAK_DETECTOR (FileSearchPath)
169 };
170 
171 } // namespace juce