2014-09-18 09:39:36 +00:00
|
|
|
#ifndef DATAFILE_H
|
|
|
|
#define DATAFILE_H
|
|
|
|
|
|
|
|
#include "system_global.h"
|
|
|
|
|
|
|
|
class QDir;
|
|
|
|
|
|
|
|
namespace paysages {
|
|
|
|
namespace system {
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Locator of data files.
|
|
|
|
*/
|
2015-11-09 21:30:46 +00:00
|
|
|
class SYSTEMSHARED_EXPORT DataFile {
|
|
|
|
public:
|
2014-09-18 09:39:36 +00:00
|
|
|
/**
|
|
|
|
* Find a data file.
|
|
|
|
*
|
|
|
|
* Return the absolute data path, or an empty string if not found.
|
|
|
|
*/
|
2015-12-10 23:36:50 +00:00
|
|
|
static string findFile(const string &relpath);
|
2014-09-18 09:39:36 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Find a data directory.
|
|
|
|
*
|
|
|
|
* Return the absolute data path, or an empty string if not found.
|
|
|
|
*/
|
2015-12-10 23:36:50 +00:00
|
|
|
static string findDir(const string &relpath);
|
2014-09-18 09:39:36 +00:00
|
|
|
|
2015-11-09 21:30:46 +00:00
|
|
|
private:
|
2014-09-18 09:39:36 +00:00
|
|
|
static bool tryDataDir(const QDir &dir);
|
2015-12-10 23:36:50 +00:00
|
|
|
static string locateDataDir();
|
|
|
|
static string initDataDir();
|
|
|
|
static string dataDir;
|
2014-09-18 09:39:36 +00:00
|
|
|
};
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
#endif // DATAFILE_H
|