paysages3d/src/system/DataFile.h

39 lines
700 B
C
Raw Permalink Normal View History

#pragma once
2014-09-18 09:39:36 +00:00
#include "system_global.h"
#include <string>
2014-09-18 09:39:36 +00:00
class QDir;
namespace paysages {
namespace system {
/**
* Locator of data files.
*/
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
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
};
}
}