81 File& operator= (
const String& newAbsolutePath);
84 File& operator= (
const File& otherFile);
106 bool existsAsFile() const;
114 bool isDirectory() const;
128 int64 getSize() const;
135 static
String descriptionOfSizeInBytes (int64 bytes);
149 const
String& getFullPathName() const noexcept {
return fullPath; }
164 String getFileName()
const;
181 String getRelativePathFrom (
const File& directoryToBeRelativeTo)
const;
192 String getFileExtension()
const;
205 bool hasFileExtension (
StringRef extensionToTest)
const;
225 String getFileNameWithoutExtension()
const;
233 int hashCode()
const;
240 int64 hashCode64()
const;
275 File getParentDirectory()
const;
286 bool isAChildOf (
const File& potentialParentDirectory)
const;
306 File getNonexistentChildFile (
const String& prefix,
308 bool putNumbersInBrackets =
true)
const;
319 File getNonexistentSibling (
bool putNumbersInBrackets =
true)
const;
323 bool operator== (
const File&)
const;
325 bool operator!= (
const File&)
const;
327 bool operator< (
const File&)
const;
329 bool operator> (
const File&)
const;
350 bool setReadOnly (
bool shouldBeReadOnly,
351 bool applyRecursively =
false)
const;
358 bool setExecutePermission (
bool shouldBeExecutable)
const;
379 Time getLastModificationTime()
const;
386 Time getLastAccessTime()
const;
393 Time getCreationTime()
const;
401 bool setLastModificationTime (
Time newTime)
const;
409 bool setLastAccessTime (
Time newTime)
const;
417 bool setCreationTime (
Time newTime)
const;
453 Result createDirectory()
const;
481 bool deleteRecursively (
bool followSymlinks =
false)
const;
505 bool moveFileTo (
const File& targetLocation)
const;
515 bool copyFileTo (
const File& targetLocation)
const;
527 bool replaceFileIn (
const File& targetLocation)
const;
542 bool copyDirectoryTo (
const File& newDirectory)
const;
551 findFilesAndDirectories = 3,
552 ignoreHiddenFiles = 4
572 bool searchRecursively,
573 const String& wildCardPattern =
"*")
const;
580 int findChildFiles (
Array<File>& results,
int whatToLookFor,
581 bool searchRecursively,
const String& wildCardPattern =
"*")
const;
599 int getNumberOfChildFiles (
int whatToLookFor,
600 const String& wildCardPattern =
"*")
const;
605 bool containsSubDirectories()
const;
680 String loadFileAsString()
const;
694 bool appendData (
const void* dataToAppend,
695 size_t numberOfBytes)
const;
711 bool replaceWithData (
const void* dataToWrite,
712 size_t numberOfBytes)
const;
727 bool appendText (
const String& textToAppend,
728 bool asUnicode =
false,
729 bool writeUnicodeHeaderBytes =
false,
730 const char* lineEndings =
"\r\n")
const;
748 bool replaceWithText (
const String& textToWrite,
749 bool asUnicode =
false,
750 bool writeUnicodeHeaderBytes =
false,
751 const char* lineEndings =
"\r\n")
const;
756 bool hasIdenticalContentTo (
const File& other)
const;
819 bool startAsProcess (
const String& parameters =
String())
const;
917 #if JUCE_WINDOWS || DOXYGEN
919 windowsSystemDirectory,
928 #if JUCE_WINDOWS || DOXYGEN
936 globalApplicationsDirectoryX86
992 static String createLegalFileName (
const String& fileNameToFix);
1001 static String createLegalPathName (
const String& pathNameToFix);
1004 static bool areFileNamesCaseSensitive();
1007 static bool isAbsolutePath (
StringRef path);
1014 static File createFileWithoutCheckingPath (
const String& absolutePath) noexcept;
1017 static String addTrailingSeparator (
const String& path);
1021 bool createSymbolicLink (
const File& linkFileToCreate,
bool overwriteExisting)
const;
1029 File getLinkedTarget()
const;
1036 static bool createSymbolicLink (
const File& linkFileToCreate,
1037 const String& nativePathOfTarget,
1038 bool overwriteExisting);
1044 #if JUCE_WINDOWS || DOXYGEN
1046 bool createShortcut (
const String& description,
const File& linkFileToCreate)
const;
1049 bool isShortcut()
const;
1055 #if JUCE_MAC || JUCE_IOS || DOXYGEN
1057 OSType getMacOSType()
const;
1060 bool isBundle()
const;
1063 #if JUCE_MAC || DOXYGEN
1065 void addToDock()
const;
1072 NaturalFileComparator (
bool shouldPutFoldersFirst) noexcept : foldersFirst (shouldPutFoldersFirst) {}
1074 int compareElements (
const File& firstFile,
const File& secondFile)
const
1079 #if NAMES_ARE_CASE_SENSITIVE
1094 JUCE_DEPRECATED_STATIC (
static const juce_wchar separator;)
1095 JUCE_DEPRECATED_STATIC (
static const StringRef separatorString;)
1096 JUCE_DEPRECATED_STATIC (
static const File nonexistent;)
1103 String getPathUpToLastSlash()
const;
1106 bool copyInternal (
const File&)
const;
1107 bool moveInternal (
const File&)
const;
1108 bool replaceInternal (
const File&)
const;
1109 bool setFileTimesInternal (int64 m, int64 a, int64 c)
const;
1110 void getFileTimesInternal (int64& m, int64& a, int64& c)
const;
1111 bool setFileReadOnlyInternal (
bool)
const;
1112 bool setFileExecutableInternal (
bool)
const;
int getVolumeSerialNumber() const
bool isSymbolicLink() const
bool isOnHardDisk() const
static void findFileSystemRoots(Array< File > &results)
bool setAsCurrentWorkingDirectory() const
bool isOnCDRomDrive() const
bool isOnRemovableDrive() const
int64 getVolumeTotalSize() const
int64 getBytesFreeOnVolume() const
const String & getFullPathName() const noexcept
bool hasWriteAccess() const
static File JUCE_CALLTYPE getSpecialLocation(const SpecialLocationType type)
void revealToUser() const
@ globalApplicationsDirectory
@ commonDocumentsDirectory
@ userApplicationDataDirectory
@ commonApplicationDataDirectory
static juce_wchar getSeparatorChar()
String getVolumeLabel() const
uint64 getFileIdentifier() const
String getVersion() const
String getNativeLinkedTarget() const
static File getCurrentWorkingDirectory()
static StringRef getSeparatorString()
int compareNatural(StringRef other, bool isCaseSensitive=false) const noexcept