20 #ifndef _STELFILEMGR_HPP_ 21 #define _STELFILEMGR_HPP_ 23 #define CHECK_FILE "data/ssystem.ini" 28 #include <QStringList> 108 static bool exists(
const QString& path);
134 static qint64
size(
const QString& path);
139 static bool mkDir(
const QString& path);
144 static QString
dirName(
const QString& path);
149 static QString
baseName(
const QString& path);
177 static void setUserDir(
const QString& newDir);
207 static bool fileFlagsCheck(
const QFileInfo& thePath,
const Flags& flags=(
Flags)0);
209 static QStringList fileLocations;
212 static QString userDir;
215 static QString screenshotDir;
218 static QString installDir;
221 static QString getWin32SpecialDirPath(
int csidlId);
228 #endif // _STELFILEMGR_HPP_ static QString getScreenshotDir()
This is the directory into which screenshots will be saved.
Flags
used as named bitfield flags as specifiers to filter results of StelFileMgr methods.
static void init()
Initialize the directories.
static void setUserDir(const QString &newDir)
Sets the user directory.
static bool isAbsolute(const QString &path)
Check if a path is absolute.
static bool isWritable(const QString &path)
Check if a path is writable For files, true is returned if the file exists and is writable or if the ...
static bool isReadable(const QString &path)
Check if a path is readable.
static QString baseName(const QString &path)
Convenience function to find the basename of a given path May return relative paths if the parameter ...
static QString getLocaleDir()
get the directory for locate files (i18n)
static qint64 size(const QString &path)
Return the size of the file at the path.
static bool exists(const QString &path)
Check if a path exists.
static void setSearchPaths(const QStringList &paths)
Set the search paths.
static QSet< QString > listContents(const QString &path, const Flags &flags=(Flags) 0, bool recursive=false)
Set a set of all possible files/directories in any Stellarium search directory.
Provides utilities for locating and handling files.
static QString dirName(const QString &path)
Convenience function to find the parent directory of a given path May return relative paths if the pa...
static bool isDirectory(const QString &path)
Check if a path exists and is a directory.
static bool mkDir(const QString &path)
Make a directory.
static const QStringList & getSearchPaths(void)
Get a vector of strings which describes the current search paths.
Search on removable media if present (default is not to).
static void setScreenshotDir(const QString &newDir)
Sets the screenshot directory.
static QString getCacheDir()
Returns the path to the cache directory. Note that subdirectories may need to be created for specific...
static QString getInstallationDir()
Returns the path to the installation directory.
static void makeSureDirExistsAndIsWritable(const QString &dirFullPath)
Make sure the passed directory path exist and is writable.
static QString getDesktopDir()
Get the user's Desktop directory.
static QString getUserDir()
Returns the path to the user directory.
Only return writable paths.
static QStringList findFileInAllPaths(const QString &path, const Flags &flags=(Flags) 0)
List all paths within the search paths that match the argument.
static QString findFile(const QString &path, Flags flags=(Flags) 0)
Search for a path within the search paths, for example "textures/fog.png".