svcore
1.9
|
#include <CachedFile.h>
Public Member Functions | |
CachedFile (QString fileOrUrl, ProgressReporter *reporter=0, QString preferredContentType="") | |
CachedFile (QUrl url, ProgressReporter *reporter=0, QString preferredContentType="") | |
virtual | ~CachedFile () |
bool | isOK () const |
QString | getLocalFilename () const |
Protected Types | |
typedef std::map< QString, QString > | OriginLocalFilenameMap |
Protected Member Functions | |
void | checkFile () |
bool | retrieve () |
QDateTime | getLastRetrieval () |
void | updateLastRetrieval (bool successful) |
Static Protected Member Functions | |
static QString | getCacheDirectory () |
static QString | getLocalFilenameFor (QUrl url) |
Protected Attributes | |
QString | m_origin |
QString | m_localFilename |
QString | m_preferredContentType |
ProgressReporter * | m_reporter |
bool | m_ok |
Static Protected Attributes | |
static OriginLocalFilenameMap | m_knownGoodCaches |
Detailed Description
Definition at line 26 of file CachedFile.h.
Member Typedef Documentation
|
protected |
Definition at line 58 of file CachedFile.h.
Constructor & Destructor Documentation
CachedFile::CachedFile | ( | QString | fileOrUrl, |
ProgressReporter * | reporter = 0 , |
||
QString | preferredContentType = "" |
||
) |
Definition at line 71 of file CachedFile.cpp.
References checkFile(), and SVDEBUG.
CachedFile::CachedFile | ( | QUrl | url, |
ProgressReporter * | reporter = 0 , |
||
QString | preferredContentType = "" |
||
) |
Definition at line 86 of file CachedFile.cpp.
References checkFile(), and SVDEBUG.
|
virtual |
Definition at line 101 of file CachedFile.cpp.
Member Function Documentation
bool CachedFile::isOK | ( | ) | const |
Definition at line 106 of file CachedFile.cpp.
References m_ok.
Referenced by PluginRDFIndexer::indexConfiguredURLs(), and PluginRDFIndexer::pullURL().
QString CachedFile::getLocalFilename | ( | ) | const |
Definition at line 112 of file CachedFile.cpp.
References m_localFilename.
Referenced by PluginRDFIndexer::indexConfiguredURLs(), and PluginRDFIndexer::pullURL().
|
protected |
!! n.b. obvious race condition here if different CachedFile
!!
!! but we do want an additional last-attempted
Definition at line 118 of file CachedFile.cpp.
References getLastRetrieval(), getLocalFilenameFor(), m_knownGoodCaches, m_localFilename, m_ok, m_origin, retrieve(), SVCERR, SVDEBUG, and updateLastRetrieval().
Referenced by CachedFile().
|
protected |
!! need to work by retrieving the file to another name, and !! then "atomically" moving it to its proper place (I'm not !! sure we can do an atomic move to replace an existing file !! using Qt classes, but a plain delete then copy is probably !! good enough)
!! This is not ideal, could leave us with nothing (old file !! removed, new file not able to be copied in because e.g. no !! disk space left)
Definition at line 183 of file CachedFile.cpp.
References FileSource::getLocalFilename(), FileSource::isAvailable(), FileSource::isOK(), m_localFilename, m_origin, m_preferredContentType, m_reporter, SVCERR, SVDEBUG, and FileSource::waitForData().
Referenced by checkFile().
|
protected |
Definition at line 235 of file CachedFile.cpp.
References m_localFilename.
Referenced by checkFile().
|
protected |
!! note !successful does not mean "we failed to update the !! file" (and so it remains the same as before); it means "the !! file is not there at all"
Definition at line 250 of file CachedFile.cpp.
References m_localFilename.
Referenced by checkFile().
|
staticprotected |
Definition at line 54 of file CachedFile.cpp.
References TempDirectory::getContainingPath(), and TempDirectory::getInstance().
Referenced by getLocalFilenameFor().
|
staticprotected |
Definition at line 39 of file CachedFile.cpp.
References getCacheDirectory().
Referenced by checkFile().
Member Data Documentation
|
protected |
Definition at line 43 of file CachedFile.h.
Referenced by checkFile(), and retrieve().
|
protected |
Definition at line 44 of file CachedFile.h.
Referenced by checkFile(), getLastRetrieval(), getLocalFilename(), retrieve(), and updateLastRetrieval().
|
protected |
Definition at line 45 of file CachedFile.h.
Referenced by retrieve().
|
protected |
Definition at line 46 of file CachedFile.h.
Referenced by retrieve().
|
protected |
Definition at line 47 of file CachedFile.h.
Referenced by checkFile(), and isOK().
|
staticprotected |
Definition at line 59 of file CachedFile.h.
Referenced by checkFile().
The documentation for this class was generated from the following files:
Generated by 1.8.11