csVfsDirectoryChanger Class Reference
Helper class to change the current VFS directory and restore the previous directory when an instance goes out of scope. More...
#include <cstool/vfsdirchange.h>
Public Member Functions | |
bool | ChangeTo (const char *filename) |
Change to the directory filename is in. | |
bool | ChangeToFull (const char *filename) |
As above, except that the full path is treated as the directory to change to. | |
csVfsDirectoryChanger (iVFS *vfs) | |
Create instance. | |
void | PushDir () |
Just pushes the current directory, but doesn't change it in anyway - useful when you want to call ChDir() or ChDirAuto() manually for some reason, but still want to have the current directory restored automatically. | |
~csVfsDirectoryChanger () | |
Destroy instance. Restores the old directory if ChangeTo() was called. |
Detailed Description
Helper class to change the current VFS directory and restore the previous directory when an instance goes out of scope.
Definition at line 31 of file vfsdirchange.h.
Constructor & Destructor Documentation
csVfsDirectoryChanger::csVfsDirectoryChanger | ( | iVFS * | vfs | ) | [inline] |
Create instance.
Definition at line 41 of file vfsdirchange.h.
csVfsDirectoryChanger::~csVfsDirectoryChanger | ( | ) | [inline] |
Destroy instance. Restores the old directory if ChangeTo() was called.
Definition at line 43 of file vfsdirchange.h.
Member Function Documentation
bool csVfsDirectoryChanger::ChangeTo | ( | const char * | filename | ) | [inline] |
Change to the directory filename is in.
- Remarks:
- Only the part of the path up to the last '/' is treated as the directory to change to. E.g. both "<tt>/foo/bar/baz</tt>" and "<tt>/foo/bar/</tt>" will cause a directory change to "<tt>/foo/bar</tt>".
Definition at line 53 of file vfsdirchange.h.
bool csVfsDirectoryChanger::ChangeToFull | ( | const char * | filename | ) | [inline] |
As above, except that the full path is treated as the directory to change to.
Definition at line 69 of file vfsdirchange.h.
void csVfsDirectoryChanger::PushDir | ( | ) | [inline] |
Just pushes the current directory, but doesn't change it in anyway - useful when you want to call ChDir() or ChDirAuto() manually for some reason, but still want to have the current directory restored automatically.
Definition at line 89 of file vfsdirchange.h.
The documentation for this class was generated from the following file:
- cstool/vfsdirchange.h
Generated for Crystal Space 2.0 by doxygen 1.6.1