comparison data/fileio/CachedFile.h @ 520:e340b2fb9471

* Make FileSource able to indicate its preferred content type (e.g. application/rdf+xml in preference to text/html for rdf content) * Temp directory on Windows -- make $HOME expand to homedrive+homepath instead of user profile location (which may be networked)
author Chris Cannam
date Thu, 11 Dec 2008 15:18:10 +0000
parents a82645e788fc
children b99dc5465b80
comparison
equal deleted inserted replaced
519:21f86744d38e 520:e340b2fb9471
24 class ProgressReporter; 24 class ProgressReporter;
25 25
26 class CachedFile 26 class CachedFile
27 { 27 {
28 public: 28 public:
29 CachedFile(QString fileOrUrl, ProgressReporter *reporter = 0); 29 CachedFile(QString fileOrUrl,
30 CachedFile(QUrl url, ProgressReporter *reporter = 0); 30 ProgressReporter *reporter = 0,
31 QString preferredContentType = "");
32 CachedFile(QUrl url,
33 ProgressReporter *reporter = 0,
34 QString preferredContentType = "");
31 35
32 virtual ~CachedFile(); 36 virtual ~CachedFile();
33 37
34 bool isOK() const; 38 bool isOK() const;
35 39
36 QString getLocalFilename() const; 40 QString getLocalFilename() const;
37 41
38 protected: 42 protected:
39 QString m_origin; 43 QString m_origin;
40 QString m_localFilename; 44 QString m_localFilename;
45 QString m_preferredContentType;
41 ProgressReporter *m_reporter; 46 ProgressReporter *m_reporter;
42 bool m_ok; 47 bool m_ok;
43 48
44 void check(); 49 void check();
45 bool retrieve(); 50 bool retrieve();