MorphoGraphX  2.0-1-227
Dir.hpp
Go to the documentation of this file.
1 //
2 // This file is part of MorphoGraphX - http://www.MorphoGraphX.org
3 // Copyright (C) 2012-2015 Richard S. Smith and collaborators.
4 //
5 // If you use MorphoGraphX in your work, please cite:
6 // http://dx.doi.org/10.7554/eLife.05864
7 //
8 // MorphoGraphX is free software, and is licensed under under the terms of the
9 // GNU General (GPL) Public License version 2.0, http://www.gnu.org/licenses.
10 //
11 #ifndef DIR_HPP
12 #define DIR_HPP
13 
14 #include <Config.hpp>
15 
16 #include <QDir>
17 
18 namespace mgx
19 {
21  mgx_EXPORT QString stripCurrentDir(QString file);
22 
24  mgx_EXPORT QString stripDir(const QString& dir, QString file);
25 
27  mgx_EXPORT QString getDir(QString file);
28 
30  mgx_EXPORT bool setCurrentPath(const QString& path);
31 
33  mgx_EXPORT QString currentPath();
34 
36  mgx_EXPORT QDir currentDir();
37 
39  mgx_EXPORT QString absoluteFilePath(QString filename);
40 
42  mgx_EXPORT QString resolvePath(QString path);
43 }
44 
45 #endif
mgx::currentDir
mgx_EXPORT QDir currentDir()
Get the current path as a directory.
mgx::resolvePath
mgx_EXPORT QString resolvePath(QString path)
Return the absolute file path, resolving things like environement variables and '~' for $HOME.
mgx
Distributed matrix library.
Definition: Assert.hpp:26
mgx::getDir
mgx_EXPORT QString getDir(QString file)
Get the directory containing a file (base of the name only)
mgx::stripDir
mgx_EXPORT QString stripDir(const QString &dir, QString file)
Remove a directory from the file path.
mgx::currentPath
mgx_EXPORT QString currentPath()
Get the current path.
mgx::stripCurrentDir
mgx_EXPORT QString stripCurrentDir(QString file)
Returns the path relative to the current directory.
mgx::setCurrentPath
mgx_EXPORT bool setCurrentPath(const QString &path)
Set the current path.
mgx::absoluteFilePath
mgx_EXPORT QString absoluteFilePath(QString filename)
Return the absolute path to a file.