168 String getFileName()
const;
196 String getFileExtension()
const;
229 String getFileNameWithoutExtension()
const;
237 int hashCode()
const;
244 int64 hashCode64()
const;
279 File getParentDirectory()
const;
312 bool putNumbersInBrackets =
true)
const;
323 File getNonexistentSibling (
bool putNumbersInBrackets =
true)
const;
383 Time getLastModificationTime()
const;
390 Time getLastAccessTime()
const;
397 Time getCreationTime()
const;
457 Result createDirectory()
const;
509 bool moveFileTo (
const File& targetLocation)
const;
519 bool copyFileTo (
const File& targetLocation)
const;
531 bool replaceFileIn (
const File& targetLocation)
const;
555 findFilesAndDirectories = 3,
556 ignoreHiddenFiles = 4
584 int findChildFiles (
Array<File>& results,
int whatToLookFor,
603 int getNumberOfChildFiles (
int whatToLookFor,
609 bool containsSubDirectories()
const;
684 String loadFileAsString()
const;
760 bool hasIdenticalContentTo (
const File&
other)
const;
823 bool startAsProcess (
const String& parameters =
String())
const;
921 #if JUCE_WINDOWS || DOXYGEN
932 #if JUCE_WINDOWS || DOXYGEN
940 globalApplicationsDirectoryX86
1008 static bool areFileNamesCaseSensitive();
1011 static bool isAbsolutePath (
StringRef path);
1021 static String addTrailingSeparator (
const String& path);
1033 File getLinkedTarget()
const;
1048 #if JUCE_WINDOWS || DOXYGEN
1059 #if JUCE_MAC || JUCE_IOS || DOXYGEN
1067 #if JUCE_MAC || DOXYGEN
1081 return firstFile.isDirectory() ? -1 : 1;
1083 #if NAMES_ARE_CASE_SENSITIVE
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;
Holds a resizable array of primitive or copy-by-value objects.
An output stream that writes into a local file.
Represents a local file or directory.
int getVolumeSerialNumber() const
Returns the serial number of the volume on which this file lives.
bool isSymbolicLink() const
Returns true if this file is a link or alias that can be followed using getLinkedTarget().
bool isHidden() const
Returns true if this file is a hidden or system file.
bool isOnHardDisk() const
Returns true if this file is on a hard disk.
static void findFileSystemRoots(Array< File > &results)
Creates a set of files to represent each file root.
bool setAsCurrentWorkingDirectory() const
Sets the current working directory to be this file.
bool isOnCDRomDrive() const
Returns true if this file is on a CD or DVD drive.
bool isOnRemovableDrive() const
Returns true if this file is on a removable disk drive.
OSType getMacOSType() const
OSX ONLY - Finds the OSType of a file from the its resources.
int64 getVolumeTotalSize() const
Returns the total size of the drive that contains this file.
int64 getBytesFreeOnVolume() const
Returns the number of bytes free on the drive that this file lives on.
bool hasWriteAccess() const
Checks whether a file can be created or written to.
static File JUCE_CALLTYPE getSpecialLocation(const SpecialLocationType type)
Finds the location of a special type of file or directory, such as a home folder or documents folder.
~File()=default
Destructor.
void revealToUser() const
Opens Finder, Explorer, or whatever the OS uses, to show the user this file's location.
SpecialLocationType
A set of types of location that can be passed to the getSpecialLocation() method.
@ userMoviesDirectory
The most likely place where a user might store their movie files.
@ userMusicDirectory
The most likely place where a user might store their music files.
@ tempDirectory
The folder that should be used for temporary files.
@ globalApplicationsDirectory
The directory in which applications normally get installed.
@ userDocumentsDirectory
The user's default documents folder.
@ currentApplicationFile
Returns this application's location.
@ invokedExecutableFile
Returns the file that was invoked to launch this executable.
@ commonDocumentsDirectory
A place to put documents which are shared by all users of the machine.
@ userApplicationDataDirectory
The folder in which applications store their persistent user-specific settings.
@ userPicturesDirectory
The most likely place where a user might store their picture files.
@ commonApplicationDataDirectory
An equivalent of the userApplicationDataDirectory folder that is shared by all users of the computer,...
@ windowsSystemDirectory
On a Windows machine, returns the location of the Windows/System32 folder.
@ userDesktopDirectory
The folder that contains the user's desktop objects.
@ hostApplicationPath
In a plugin, this will return the path of the host executable.
@ currentExecutableFile
Returns this application's executable file.
@ userHomeDirectory
The user's home folder.
TypesOfFileToFind
Used in file searching, to specify whether to return files, directories, or both.
bool isShortcut() const
Windows ONLY - Returns true if this is a win32 .LNK file.
static juce_wchar getSeparatorChar()
The system-specific file separator character.
void addToDock() const
OSX ONLY - Adds this file to the OSX dock.
bool isBundle() const
OSX ONLY - Returns true if this file is actually a bundle.
bool moveToTrash() const
Moves this file or folder to the trash.
String getVolumeLabel() const
Finds the name of the drive on which this file lives.
uint64 getFileIdentifier() const
Returns a unique identifier for the file, if one is available.
File()=default
Creates an (invalid) file object.
bool deleteFile() const
Deletes a file.
String getVersion() const
If possible, this will try to create a version string for the given file.
String getNativeLinkedTarget() const
This returns the native path that the symbolic link points to.
bool createShortcut(const String &description, const File &linkFileToCreate) const
Windows ONLY - Creates a win32 .LNK shortcut file that links to this file.
static File getCurrentWorkingDirectory()
Returns the current working directory.
static StringRef getSeparatorString()
The system-specific file separator character, as a string.
A class to hold a resizable block of raw data.
Represents the 'success' or 'failure' of an operation, and holds an associated error message to descr...
A special array for holding a list of strings.
A simple class for holding temporary references to a string literal or String.
Holds an absolute date and time.
#define JUCE_API
This macro is added to all JUCE public class declarations.