Pointwise Plugin SDK
|
Manipulates the current working directory. More...
#include <PwpCwd.h>
Public Member Functions | |
bool | pop () |
Restores the current working directory. More... | |
bool | push (const char *dir) |
Sets the current working directory. More... | |
PwpCwd (const char *dir=0) | |
Constructor. More... | |
~PwpCwd () | |
Destructor. More... | |
Static Public Member Functions | |
static bool | popDir () |
Restores the current working directory. More... | |
static bool | pushDir (const char *dir) |
Sets the current working directory. More... | |
Private Attributes | |
int | depth_ |
The stack depth. More... | |
Manipulates the current working directory.
The PwpCwd class pushes and pops the current working directory onto the shared directory stack using the global functions pwpCwdPush() and pwpCwdPop().
To prevent push/pop mismatches, two PwpCwd objects should never exist in the same scope.
PwpCwd::PwpCwd | ( | const char * | dir = 0 | ) |
Constructor.
Constructs instance and pushes dir.
dir | The directory to make current |
Definition at line 14 of file PwpCwd.cxx.
References push().
PwpCwd::~PwpCwd | ( | ) |
bool PwpCwd::pop | ( | ) |
|
static |
Restores the current working directory.
This method pops directly from the global directory stack using pwpCwdPop(). It should only be called after a corresponding call to pushDir().
Definition at line 54 of file PwpCwd.cxx.
References pwpCwdPop().
Referenced by pop().
bool PwpCwd::push | ( | const char * | dir | ) |
Sets the current working directory.
Each PwpCwd object maintains a local directory stack internally. It can only pop() directories it has pushed.
dir | The directory to make current |
Definition at line 27 of file PwpCwd.cxx.
References depth_, and pushDir().
Referenced by FileDestPwpCwd::FileDestPwpCwd(), and PwpCwd().
|
static |
Sets the current working directory.
This method pushes directly onto the global directory stack using pwpCwdPush(). It is the caller's responsibility to make a corresponding call to popDir().
dir | The directory to make current |
Definition at line 48 of file PwpCwd.cxx.
References pwpCwdPush().
Referenced by push().
|
private |