OpenShot Library | libopenshot-audio
0.2.0
|
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)
File operator[](int index) const
Returns one of the folders in this search path.
void remove(int indexToRemove)
Removes a directory from the search path.
File getParentDirectory() const
Returns the directory that contains this file or directory.
void trim()
Deletes any whitespace characters from the starts and ends of all the strings.
void removeEmptyStrings(bool removeWhitespaceStrings=true)
Removes empty strings from the array.
const String & getFullPathName() const noexcept
Returns the complete, absolute path of this file.
bool isAChildOf(const File &potentialParentDirectory) const
Checks whether a file is somewhere inside a directory.
Holds a resizable array of primitive or copy-by-value objects.
FileSearchPath()
Creates an empty search path.
Represents a local file or directory.
~FileSearchPath()
Destructor.
String toString() const
Returns the search path as a semicolon-separated list of directories.
FileSearchPath & operator=(const FileSearchPath &)
Copies another search path.
void addPath(const FileSearchPath &)
Merges another search path into this one.
void removeNonExistentPaths()
Removes any directories that don't actually exist.
void add(const File &directoryToAdd, int insertIndex=-1)
Adds a new directory to the search path.
String quoted(juce_wchar quoteCharacter='"') const
Adds quotation marks around a string.
int addTokens(StringRef stringToTokenise, bool preserveQuotedStrings)
Breaks up a string into tokens and adds them to this array.
Array< File > findChildFiles(int whatToLookFor, bool searchRecursively, const String &wildCardPattern="*") const
Searches this directory for files matching a wildcard pattern.
int getNumPaths() const
Returns the number of folders in this search path.
void removeRedundantPaths()
Removes any directories that are actually subdirectories of one of the other directories in the searc...
Array< File > findChildFiles(int whatToLookFor, bool searchRecursively, const String &wildCardPattern="*") const
Searches the path for a wildcard.
Represents a set of folders that make up a search path.
void clear()
Removes all elements from the array.
bool addIfNotAlreadyThere(const File &directoryToAdd)
Adds a new directory to the search path if it's not already in there.
bool isFileInPath(const File &fileToCheck, bool checkRecursively) const
Finds out whether a file is inside one of the path's directories.