ResourceFinder.h
Go to the documentation of this file.
1 /* -*- c-basic-offset: 4 indent-tabs-mode: nil -*- vi:set ts=8 sts=4 sw=4: */
2 
3 /*
4  Sonic Visualiser
5  An audio file viewer and annotation editor.
6  Centre for Digital Music, Queen Mary, University of London.
7 
8  This program is free software; you can redistribute it and/or
9  modify it under the terms of the GNU General Public License as
10  published by the Free Software Foundation; either version 2 of the
11  License, or (at your option) any later version. See the file
12  COPYING included with this distribution for more information.
13 */
14 
15 /*
16  This is a modified version of a source file from the
17  Rosegarden MIDI and audio sequencer and notation editor.
18  This file copyright 2005-2011 Chris Cannam and the Rosegarden
19  development team.
20 */
21 
22 #ifndef SV_RESOURCE_FINDER_H
23 #define SV_RESOURCE_FINDER_H
24 
25 #include <QString>
26 
27 #include "Debug.h"
28 
30 {
31 public:
33  virtual ~ResourceFinder() { }
34 
50  QString getResourcePath(QString resourceCat, QString fileName);
51 
66  QStringList getResourceFiles(QString resourceCat, QString fileExt);
67 
81  QString getResourceDir(QString resourceCat);
82 
89  QString getResourceSavePath(QString resourceCat, QString fileName);
90 
95  QString getResourceSaveDir(QString resourceCat);
96 
111  bool unbundleResource(QString resourceCat, QString fileName);
112 
118  QString getUserResourcePrefix();
119 
124  QStringList getSystemResourcePrefixList();
125 
133  QStringList getResourcePrefixList();
134 };
135 
136 #endif
137 
138 
virtual ~ResourceFinder()
QString getResourceSaveDir(QString resourceCat)
Return the true file path for the location in which resource files in the given resource category sho...
QStringList getResourcePrefixList()
Return all root paths for resource installations for this application, in the order in which they wil...
QString getResourcePath(QString resourceCat, QString fileName)
Return the location (as a true file path, or a Qt4 ":"-prefixed resource path) of the file best match...
QStringList getResourceFiles(QString resourceCat, QString fileExt)
Return a list of full file paths for files with the given file extension, found in the given resource...
QStringList getSystemResourcePrefixList()
Return the root paths for systemwide resource installations for this application. ...
QString getUserResourcePrefix()
Return the root path for user-specific resource installation for this application (i...
bool unbundleResource(QString resourceCat, QString fileName)
If the named resource file in the given resource category is available only as a bundled resource...
QString getResourceSavePath(QString resourceCat, QString fileName)
Return the true file path for the location in which the named resource file in the given resource cat...
QString getResourceDir(QString resourceCat)
Return the true file path for installed resource files in the given resource category.