#include <TempDirectory.h>
Collaboration diagram for TempDirectory:

There is one root temporary directory for the program, created on demand and deleted when the program exits.
This class is thread safe.
Definition at line 33 of file TempDirectory.h.
Public Member Functions | |
| virtual | ~TempDirectory () |
| QString | getPath () |
| Create the root temporary directory if necessary, and return its path. | |
| QString | getSubDirectoryPath (QString subdir) |
| Create an immediate subdirectory of the root temporary directory of the given name, if it doesn't already exist, and return its path. | |
| void | cleanup () |
| Delete the temporary directory (before exiting). | |
Static Public Member Functions | |
| static TempDirectory * | getInstance () |
Protected Member Functions | |
| TempDirectory () | |
| QString | createTempDirectoryIn (QString inDir) |
| void | cleanupDirectory (QString tmpDir) |
| void | cleanupAbandonedDirectories (QString svDir) |
Protected Attributes | |
| QString | m_tmpdir |
| QMutex | m_mutex |
Static Protected Attributes | |
| static TempDirectory * | m_instance |
| TempDirectory::~TempDirectory | ( | ) | [virtual] |
| TempDirectory::TempDirectory | ( | ) | [protected] |
Definition at line 37 of file TempDirectory.cpp.
| TempDirectory * TempDirectory::getInstance | ( | ) | [static] |
Definition at line 32 of file TempDirectory.cpp.
References m_instance.
Referenced by FileSource::createCacheFile(), AudioGenerator::getSampleDir(), CodedAudioFileReader::initialiseDecodeCache(), main(), MatrixFile::MatrixFile(), StorageAdviser::recommend(), signalHandler(), and WritableWaveFileModel::WritableWaveFileModel().
| QString TempDirectory::getPath | ( | ) |
Create the root temporary directory if necessary, and return its path.
Throw DirectoryCreationFailed if the directory cannot be created.
Definition at line 56 of file TempDirectory.cpp.
References cleanupAbandonedDirectories(), createTempDirectoryIn(), m_mutex, and m_tmpdir.
Referenced by getSubDirectoryPath(), and StorageAdviser::recommend().
| QString TempDirectory::getSubDirectoryPath | ( | QString | subdir | ) |
Create an immediate subdirectory of the root temporary directory of the given name, if it doesn't already exist, and return its path.
Throw DirectoryCreationFailed if the directory cannot be created.
Definition at line 146 of file TempDirectory.cpp.
References getPath(), and m_mutex.
Referenced by FileSource::createCacheFile(), and AudioGenerator::getSampleDir().
| void TempDirectory::cleanup | ( | ) |
Delete the temporary directory (before exiting).
Definition at line 50 of file TempDirectory.cpp.
References cleanupDirectory().
Referenced by main(), signalHandler(), and ~TempDirectory().
| QString TempDirectory::createTempDirectoryIn | ( | QString | inDir | ) | [protected] |
| void TempDirectory::cleanupDirectory | ( | QString | tmpDir | ) | [protected] |
Definition at line 169 of file TempDirectory.cpp.
References m_mutex, and m_tmpdir.
Referenced by cleanup(), and cleanupAbandonedDirectories().
| void TempDirectory::cleanupAbandonedDirectories | ( | QString | svDir | ) | [protected] |
Definition at line 228 of file TempDirectory.cpp.
References cleanupDirectory(), GetProcessStatus(), and ProcessNotRunning.
Referenced by getPath().
QString TempDirectory::m_tmpdir [protected] |
Definition at line 67 of file TempDirectory.h.
Referenced by cleanupDirectory(), createTempDirectoryIn(), and getPath().
QMutex TempDirectory::m_mutex [protected] |
Definition at line 68 of file TempDirectory.h.
Referenced by cleanupDirectory(), getPath(), and getSubDirectoryPath().
TempDirectory * TempDirectory::m_instance [static, protected] |
1.5.1