53 : temporaryFile (createTempFile (
File::getSpecialLocation (
File::tempDirectory),
54 "temp_" +
String::toHexString (lockedRandom.nextInt()),
61 : temporaryFile (createTempFile (target.getParentDirectory(),
62 target.getFileNameWithoutExtension()
63 +
"_temp" +
String::toHexString (lockedRandom.nextInt()),
72 : temporaryFile (
temporary), targetFile (target)
99 if (temporaryFile.
exists())
102 for (
int i = 5; --i >= 0;)
123 for (
int i = 5; --i >= 0;)
Represents a local file or directory.
bool isDirectory() const
Checks whether the file is a directory that exists.
bool deleteRecursively(bool followSymlinks=false) const
Deletes a file or directory and all its subdirectories.
bool deleteFile() const
Deletes a file.
bool replaceFileIn(const File &targetLocation) const
Replaces a file.
bool exists() const
Checks whether the file actually exists.
Automatically locks and unlocks a mutex object.
A random number generator.
int nextInt() noexcept
Returns the next random 32 bit integer.
@ putNumbersInBrackets
Indicates that when numbers are appended to make sure the file is unique, they should go in brackets ...
@ useHiddenFile
Indicates that the temporary file should be hidden - i.e.
bool deleteTemporaryFile() const
Attempts to delete the temporary file, if it exists.
bool overwriteTargetFileWithTemporary() const
Tries to move the temporary file to overwrite the target file that was specified in the constructor.
~TemporaryFile()
Destructor.
TemporaryFile(const String &suffix=String(), int optionFlags=0)
Creates a randomly-named temporary file in the default temp directory.
static void JUCE_CALLTYPE sleep(int milliseconds)
Suspends the execution of the current thread until the specified timeout period has elapsed (note tha...
Type unalignedPointerCast(void *ptr) noexcept
Casts a pointer to another type via void*, which suppresses the cast-align warning which sometimes ar...