35 : directories (
other.directories)
41 directories =
other.directories;
51void 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);
105 for (
int i = 0; i <
other.getNumPaths(); ++i)
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))
130 for (
int i = directories.
size(); --i >= 0;)
147 for (
auto& d : directories)
156 for (
auto& d : directories)
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.
bool isDirectory() const
Checks whether the file is a directory that exists.
Array< File > findChildFiles(int whatToLookFor, bool searchRecursively, const String &wildCardPattern="*") const
Searches this directory for files matching a wildcard pattern.
void removeEmptyStrings(bool removeWhitespaceStrings=true)
Removes empty strings from the array.
void insert(int index, String stringToAdd)
Inserts a string into the array.
void clear()
Removes all elements from the array.
int size() const noexcept
Returns the number of strings in the array.
void trim()
Deletes any whitespace characters from the starts and ends of all the strings.
void remove(int index)
Removes a string from the array.
int addTokens(StringRef stringToTokenise, bool preserveQuotedStrings)
Breaks up a string into tokens and adds them to this array.