35 : directories (other.directories)
41 directories = other.directories;
51 void FileSearchPath::init (
const String& path)
58 for (
auto& d : directories)
64 return directories.size();
69 return File (directories[index]);
74 auto dirs = directories;
77 if (d.containsChar (
';'))
80 return dirs.joinIntoString (
";");
90 for (
auto& d : directories)
100 directories.remove (index);
111 for (
int i = directories.size(); --i >= 0;)
113 const File d1 (directories[i]);
115 for (
int j = directories.size(); --j >= 0;)
117 const File d2 (directories[j]);
119 if (i != j && (d1.
isAChildOf (d2) || d1 == d2))
121 directories.remove (i);
130 for (
int i = directories.size(); --i >= 0;)
131 if (!
File (directories[i]).isDirectory())
132 directories.remove (i);
143 bool recurse,
const String& wildcard)
const
147 for (
auto& d : directories)
154 const bool checkRecursively)
const
156 for (
auto& d : directories)
158 if (checkRecursively)
Holds a resizable array of primitive or copy-by-value objects.
Represents a set of folders that make up a search path.
~FileSearchPath()
Destructor.
bool isFileInPath(const File &fileToCheck, bool checkRecursively) const
Finds out whether a file is inside one of the path's directories.
void add(const File &directoryToAdd, int insertIndex=-1)
Adds a new directory to the search path.
void remove(int indexToRemove)
Removes a directory from the search path.
void removeNonExistentPaths()
Removes any directories that don't actually exist.
FileSearchPath & operator=(const FileSearchPath &)
Copies another search path.
void addPath(const FileSearchPath &)
Merges another search path into this one.
String toString() const
Returns the search path as a semicolon-separated list of directories.
int getNumPaths() const
Returns the number of folders in this search path.
File operator[](int index) const
Returns one of the folders in this search path.
void removeRedundantPaths()
Removes any directories that are actually subdirectories of one of the other directories in the searc...
bool addIfNotAlreadyThere(const File &directoryToAdd)
Adds a new directory to the search path if it's not already in there.
FileSearchPath()
Creates an empty search path.
Array< File > findChildFiles(int whatToLookFor, bool searchRecursively, const String &wildCardPattern="*") const
Searches the path for a wildcard.
Represents a local file or directory.
const String & getFullPathName() const noexcept
Returns the complete, absolute path of this file.
Array< File > findChildFiles(int whatToLookFor, bool searchRecursively, const String &wildCardPattern="*") const
Searches this directory for files matching a wildcard pattern.
File getParentDirectory() const
Returns the directory that contains this file or directory.
bool isAChildOf(const File &potentialParentDirectory) const
Checks whether a file is somewhere inside a directory.
void removeEmptyStrings(bool removeWhitespaceStrings=true)
Removes empty strings from the array.
void clear()
Removes all elements from the array.
void trim()
Deletes any whitespace characters from the starts and ends of all the strings.
int addTokens(StringRef stringToTokenise, bool preserveQuotedStrings)
Breaks up a string into tokens and adds them to this array.
String quoted(juce_wchar quoteCharacter='"') const
Adds quotation marks around a string.