85 File& operator= (
const String& newAbsolutePath);
88 File& operator= (
const File& otherFile);
110 bool existsAsFile()
const;
118 bool isDirectory()
const;
132 int64 getSize()
const;
139 static String descriptionOfSizeInBytes (int64 bytes);
168 String getFileName()
const;
185 String getRelativePathFrom (
const File& directoryToBeRelativeTo)
const;
196 String getFileExtension()
const;
209 bool hasFileExtension (
StringRef extensionToTest)
const;
229 String getFileNameWithoutExtension()
const;
237 int hashCode()
const;
244 int64 hashCode64()
const;
279 File getParentDirectory()
const;
290 bool isAChildOf (
const File& potentialParentDirectory)
const;
310 File getNonexistentChildFile (
const String& prefix,
312 bool putNumbersInBrackets =
true)
const;
323 File getNonexistentSibling (
bool putNumbersInBrackets =
true)
const;
327 bool operator== (
const File&)
const;
329 bool operator!= (
const File&)
const;
331 bool operator< (
const File&)
const;
333 bool operator> (
const File&)
const;
343 bool hasWriteAccess()
const;
354 bool setReadOnly (
bool shouldBeReadOnly,
355 bool applyRecursively =
false)
const;
362 bool setExecutePermission (
bool shouldBeExecutable)
const;
367 bool isHidden()
const;
375 uint64 getFileIdentifier()
const;
383 Time getLastModificationTime()
const;
390 Time getLastAccessTime()
const;
397 Time getCreationTime()
const;
405 bool setLastModificationTime (
Time newTime)
const;
413 bool setLastAccessTime (
Time newTime)
const;
421 bool setCreationTime (
Time newTime)
const;
429 String getVersion()
const;
457 Result createDirectory()
const;
471 bool deleteFile()
const;
485 bool deleteRecursively (
bool followSymlinks =
false)
const;
493 bool moveToTrash()
const;
509 bool moveFileTo (
const File& targetLocation)
const;
519 bool copyFileTo (
const File& targetLocation)
const;
531 bool replaceFileIn (
const File& targetLocation)
const;
546 bool copyDirectoryTo (
const File& newDirectory)
const;
555 findFilesAndDirectories = 3,
556 ignoreHiddenFiles = 4
576 bool searchRecursively,
577 const String& wildCardPattern =
"*")
const;
584 int findChildFiles (
Array<File>& results,
int whatToLookFor,
585 bool searchRecursively,
const String& wildCardPattern =
"*")
const;
603 int getNumberOfChildFiles (
int whatToLookFor,
604 const String& wildCardPattern =
"*")
const;
609 bool containsSubDirectories()
const;
684 String loadFileAsString()
const;
698 bool appendData (
const void* dataToAppend,
699 size_t numberOfBytes)
const;
715 bool replaceWithData (
const void* dataToWrite,
716 size_t numberOfBytes)
const;
731 bool appendText (
const String& textToAppend,
732 bool asUnicode =
false,
733 bool writeUnicodeHeaderBytes =
false,
734 const char* lineEndings =
"\r\n")
const;
752 bool replaceWithText (
const String& textToWrite,
753 bool asUnicode =
false,
754 bool writeUnicodeHeaderBytes =
false,
755 const char* lineEndings =
"\r\n")
const;
760 bool hasIdenticalContentTo (
const File& other)
const;
769 static void findFileSystemRoots (
Array<File>& results);
774 String getVolumeLabel()
const;
779 int getVolumeSerialNumber()
const;
786 int64 getBytesFreeOnVolume()
const;
793 int64 getVolumeTotalSize()
const;
796 bool isOnCDRomDrive()
const;
803 bool isOnHardDisk()
const;
809 bool isOnRemovableDrive()
const;
823 bool startAsProcess (
const String& parameters =
String())
const;
828 void revealToUser()
const;
921 #if JUCE_WINDOWS || DOXYGEN 932 #if JUCE_WINDOWS || DOXYGEN 940 globalApplicationsDirectoryX86
962 static File getCurrentWorkingDirectory();
971 bool setAsCurrentWorkingDirectory()
const;
977 static juce_wchar getSeparatorChar();
996 static String createLegalFileName (
const String& fileNameToFix);
1005 static String createLegalPathName (
const String& pathNameToFix);
1008 static bool areFileNamesCaseSensitive();
1011 static bool isAbsolutePath (
StringRef path);
1018 static File createFileWithoutCheckingPath (
const String& absolutePath) noexcept;
1021 static String addTrailingSeparator (
const String& path);
1025 bool createSymbolicLink (
const File& linkFileToCreate,
bool overwriteExisting)
const;
1028 bool isSymbolicLink()
const;
1033 File getLinkedTarget()
const;
1040 static bool createSymbolicLink (
const File& linkFileToCreate,
1041 const String& nativePathOfTarget,
1042 bool overwriteExisting);
1046 String getNativeLinkedTarget()
const;
1048 #if JUCE_WINDOWS || DOXYGEN 1050 bool createShortcut (
const String& description,
const File& linkFileToCreate)
const;
1053 bool isShortcut()
const;
1059 #if JUCE_MAC || JUCE_IOS || DOXYGEN 1061 OSType getMacOSType()
const;
1064 bool isBundle()
const;
1067 #if JUCE_MAC || DOXYGEN 1069 void addToDock()
const;
1076 NaturalFileComparator (
bool shouldPutFoldersFirst) noexcept : foldersFirst (shouldPutFoldersFirst) {}
1078 int compareElements (
const File& firstFile,
const File& secondFile)
const 1083 #if NAMES_ARE_CASE_SENSITIVE 1098 JUCE_DEPRECATED_STATIC (
static const juce_wchar separator;)
1099 JUCE_DEPRECATED_STATIC (
static const StringRef separatorString;)
1100 JUCE_DEPRECATED_STATIC (
static const File nonexistent;)
1107 String getPathUpToLastSlash()
const;
1110 bool copyInternal (
const File&)
const;
1111 bool moveInternal (
const File&)
const;
1112 bool replaceInternal (
const File&)
const;
1113 bool setFileTimesInternal (int64 m, int64 a, int64 c)
const;
1114 void getFileTimesInternal (int64& m, int64& a, int64& c)
const;
1115 bool setFileReadOnlyInternal (
bool)
const;
1116 bool setFileExecutableInternal (
bool)
const;
#define JUCE_API
This macro is added to all JUCE public class declarations.
The most likely place where a user might store their movie files.
The user's default documents folder.
A simple class for holding temporary references to a string literal or String.
An equivalent of the userApplicationDataDirectory folder that is shared by all users of the computer...
In a plugin, this will return the path of the host executable.
The user's home folder.
int compareNatural(StringRef other, bool isCaseSensitive=false) const noexcept
Compares two strings, taking into account textual characteristics like numbers and spaces...
A place to put documents which are shared by all users of the machine.
A special array for holding a list of strings.
Returns this application's executable file.
The directory in which applications normally get installed.
Represents the 'success' or 'failure' of an operation, and holds an associated error message to descr...
Represents a local file or directory.
Holds a resizable array of primitive or copy-by-value objects.
On a Windows machine, returns the location of the Windows/System32 folder.
An output stream that writes into a local file.
The folder in which applications store their persistent user-specific settings.
SpecialLocationType
A set of types of location that can be passed to the getSpecialLocation() method. ...
TypesOfFileToFind
Used in file searching, to specify whether to return files, directories, or both. ...
bool isDirectory() const
Checks whether the file is a directory that exists.
The folder that contains the user's desktop objects.
The most likely place where a user might store their picture files.
A class to hold a resizable block of raw data.
Holds an absolute date and time.
const String & getFullPathName() const noexcept
Returns the complete, absolute path of this file.
Returns the file that was invoked to launch this executable.
Returns this application's location.
The folder that should be used for temporary files.
The most likely place where a user might store their music files.