svcore
1.9
|
A class that manages the creation and removal of a temporary directory tree to store data during the program run. More...
#include <TempDirectory.h>
Public Member Functions | |
virtual | ~TempDirectory () |
QString | getContainingPath () |
Return the path of the directory in which the temporary directory has been or will be created. More... | |
QString | getPath () |
Create the root temporary directory if necessary, and return its path. More... | |
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. More... | |
void | cleanup () |
Delete the temporary directory (before exiting). More... | |
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 = new TempDirectory |
Detailed Description
A class that manages the creation and removal of a temporary directory tree to store data during the program run.
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.
Constructor & Destructor Documentation
|
virtual |
Definition at line 45 of file TempDirectory.cpp.
|
protected |
Definition at line 40 of file TempDirectory.cpp.
Member Function Documentation
|
static |
Definition at line 35 of file TempDirectory.cpp.
References m_instance.
Referenced by FileSource::createCacheFile(), CachedFile::getCacheDirectory(), RecordDirectory::getRecordContainerDirectory(), WritableWaveFileModel::init(), CodedAudioFileReader::initialiseDecodeCache(), CodedAudioFileReader::pushBufferNonResampling(), and StorageAdviser::recommend().
QString TempDirectory::getContainingPath | ( | ) |
Return the path of the directory in which the temporary directory has been or will be created.
This directory is particular to this application, although not to this instance of it, and it will not be removed when the application exits. Persistent cache data or similar may be placed in this directory or other, non-temporary subdirectories of it.
If this directory does not exist, it will be created. Throw DirectoryCreationFailed if the directory cannot be created.
!! iffy
Definition at line 59 of file TempDirectory.cpp.
References cleanupAbandonedDirectories(), ResourceFinder::getUserResourcePrefix(), and m_mutex.
Referenced by CachedFile::getCacheDirectory(), and getPath().
QString TempDirectory::getPath | ( | ) |
Create the root temporary directory if necessary, and return its path.
This directory will be removed when the application exits.
Throw DirectoryCreationFailed if the directory cannot be created.
Definition at line 90 of file TempDirectory.cpp.
References createTempDirectoryIn(), getContainingPath(), 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.
This directory will be removed when the application exits.
Throw DirectoryCreationFailed if the directory cannot be created.
Definition at line 157 of file TempDirectory.cpp.
void TempDirectory::cleanup | ( | ) |
Delete the temporary directory (before exiting).
Definition at line 53 of file TempDirectory.cpp.
References cleanupDirectory().
Referenced by ~TempDirectory().
|
protected |
|
protected |
Definition at line 180 of file TempDirectory.cpp.
References m_mutex, and m_tmpdir.
Referenced by cleanup(), and cleanupAbandonedDirectories().
|
protected |
Definition at line 239 of file TempDirectory.cpp.
References cleanupDirectory(), GetProcessStatus(), and ProcessNotRunning.
Referenced by getContainingPath().
Member Data Documentation
|
protected |
Definition at line 86 of file TempDirectory.h.
Referenced by cleanupDirectory(), createTempDirectoryIn(), and getPath().
|
protected |
Definition at line 87 of file TempDirectory.h.
Referenced by cleanupDirectory(), getContainingPath(), and getSubDirectoryPath().
|
staticprotected |
Definition at line 89 of file TempDirectory.h.
Referenced by getInstance().
The documentation for this class was generated from the following files:
Generated by 1.8.11