paysages3d/src/system/DataFile.h

40 lines
763 B
C
Raw Normal View History

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.
*/
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.
*/
static std::string findFile(const std::string &relpath);
/**
* Find a data directory.
*
* Return the absolute data path, or an empty string if not found.
*/
static std::string findDir(const std::string &relpath);
private:
2014-09-18 09:39:36 +00:00
static bool tryDataDir(const QDir &dir);
static std::string locateDataDir();
static std::string initDataDir();
static std::string dataDir;
};
}
}
#endif // DATAFILE_H