Loading...
Searching...
No Matches
juce_FileSearchPath.h
/*
==============================================================================
This file is part of the JUCE library.
Copyright (c) 2022 - Raw Material Software Limited
JUCE is an open source library subject to commercial or open-source
licensing.
The code included in this file is provided under the terms of the ISC license
http://www.isc.org/downloads/software-support-policy/isc-license. Permission
To use, copy, modify, and/or distribute this software for any purpose with or
without fee is hereby granted provided that the above copyright notice and
this permission notice appear in all copies.
JUCE IS PROVIDED "AS IS" WITHOUT ANY WARRANTY, AND ALL WARRANTIES, WHETHER
EXPRESSED OR IMPLIED, INCLUDING MERCHANTABILITY AND FITNESS FOR PURPOSE, ARE
DISCLAIMED.
==============================================================================
*/
namespace juce
{
//==============================================================================
class JUCE_API FileSearchPath
{
public:
//==============================================================================
FileSearchPath() = default;
~FileSearchPath() = default;
FileSearchPath (const String& path);
FileSearchPath (const FileSearchPath&);
FileSearchPath& operator= (const FileSearchPath&);
FileSearchPath& operator= (const String& path);
//==============================================================================
int getNumPaths() const;
File operator[] (int index) const;
String getRawString (int index) const;
String toString() const;
String toStringWithSeparator (StringRef separator) const;
//==============================================================================
void add (const File& directoryToAdd,
int insertIndex = -1);
bool addIfNotAlreadyThere (const File& directoryToAdd);
void remove (int indexToRemove);
void addPath (const FileSearchPath&);
void removeRedundantPaths();
void removeNonExistentPaths();
//==============================================================================
Array<File> findChildFiles (int whatToLookFor,
bool searchRecursively,
const String& wildCardPattern = "*") const;
int findChildFiles (Array<File>& results,
int whatToLookFor,
bool searchRecursively,
const String& wildCardPattern = "*") const;
//==============================================================================
bool isFileInPath (const File& fileToCheck,
bool checkRecursively) const;
private:
//==============================================================================
StringArray directories;
void init (const String&);
JUCE_LEAK_DETECTOR (FileSearchPath)
};
} // namespace juce
juce::Array
Definition juce_Array.h:56
juce::FileSearchPath::isFileInPath
bool isFileInPath(const File &fileToCheck, bool checkRecursively) const
Definition juce_FileSearchPath.cpp:169
juce::FileSearchPath::add
void add(const File &directoryToAdd, int insertIndex=-1)
Definition juce_FileSearchPath.cpp:90
juce::FileSearchPath::remove
void remove(int indexToRemove)
Definition juce_FileSearchPath.cpp:105
juce::FileSearchPath::removeNonExistentPaths
void removeNonExistentPaths()
Definition juce_FileSearchPath.cpp:144
juce::FileSearchPath::addPath
void addPath(const FileSearchPath &)
Definition juce_FileSearchPath.cpp:110
juce::FileSearchPath::toString
String toString() const
Definition juce_FileSearchPath.cpp:74
juce::FileSearchPath::getNumPaths
int getNumPaths() const
Definition juce_FileSearchPath.cpp:59
juce::FileSearchPath::~FileSearchPath
~FileSearchPath()=default
juce::FileSearchPath::removeRedundantPaths
void removeRedundantPaths()
Definition juce_FileSearchPath.cpp:116
juce::FileSearchPath::FileSearchPath
FileSearchPath()=default
juce::FileSearchPath::addIfNotAlreadyThere
bool addIfNotAlreadyThere(const File &directoryToAdd)
Definition juce_FileSearchPath.cpp:95
juce::FileSearchPath::toStringWithSeparator
String toStringWithSeparator(StringRef separator) const
Definition juce_FileSearchPath.cpp:79
juce::FileSearchPath::findChildFiles
Array< File > findChildFiles(int whatToLookFor, bool searchRecursively, const String &wildCardPattern="*") const
Definition juce_FileSearchPath.cpp:151
juce::FileSearchPath::getRawString
String getRawString(int index) const
Definition juce_FileSearchPath.cpp:69
juce::File
Definition juce_File.h:45
juce::StringArray
Definition juce_StringArray.h:35
juce::StringRef
Definition juce_StringRef.h:62
juce::String
Definition juce_String.h:53