Use this class to change the current application directory in a given scope and automatically restore it.
More...
#include <Libs/Core/ctkScopedCurrentDir.h>
|
QScopedPointer< ctkScopedCurrentDirPrivate > | d_ptr |
|
Use this class to change the current application directory in a given scope and automatically restore it.
This is particulary useful in case a plugin and its dependent libraries should be loaded from a known directory. Indeed, changing the application PATH, LD_LIBRARY_PATH or DYLD_LIBRARY_PATH within the current process won't have the desired effect. The loader checks for these variables only once when the process starts.
- See also
- http://stackoverflow.com/questions/856116/changing-ld-library-path-at-runtime-for-ctypes
-
http://stackoverflow.com/questions/1178094/change-current-process-environment
Definition at line 45 of file ctkScopedCurrentDir.h.
◆ ctkScopedCurrentDir()
ctkScopedCurrentDir::ctkScopedCurrentDir |
( |
const QString & |
path | ) |
|
|
explicit |
◆ ~ctkScopedCurrentDir()
virtual ctkScopedCurrentDir::~ctkScopedCurrentDir |
( |
| ) |
|
|
virtual |
◆ currentPath()
QString ctkScopedCurrentDir::currentPath |
( |
| ) |
const |
Return the current application path
- See also
- QDir::currentPath
◆ savedCurrentPath()
QString ctkScopedCurrentDir::savedCurrentPath |
( |
| ) |
const |
Return saved current path.
◆ d_ptr
QScopedPointer<ctkScopedCurrentDirPrivate> ctkScopedCurrentDir::d_ptr |
|
protected |
The documentation for this class was generated from the following file: