#include <unixstl/filesystem/current_directory_scope.hpp>
This class scopes the process's current directory, by changing to the path given in the constructor, and then, if that succeeded, changing back in the destructor.
C | The character type (e.g. char , wchar_t ). | |
T | The file-system traits. In translators that support default template parameters that defaults to filesystem_traits<C> . |
State | |
operator operator_bool_type () const | |
Indicates whether the construction was successful. | |
Public Types | |
typedef C | char_type |
Public Member Functions | |
basic_current_directory_scope (char_type const *dir) | |
Constructs a scope instance and changes to the given directory. | |
template<typename S> | |
basic_current_directory_scope (S const &dir) | |
Constructs a scope instance and changes to the given directory. | |
~basic_current_directory_scope () throw () | |
Returns the current directory to its original location. | |
char_type const * | get_previous () const |
Returns a C-string pointer to the original directory. | |
operator char_type const * () const | |
Returns a C-string pointer to the original directory. |
typedef C char_type |
The character type
basic_current_directory_scope | ( | char_type const * | dir | ) | [explicit] |
Constructs a scope instance and changes to the given directory.
dir | The name of the directory to change the current directory to |
basic_current_directory_scope | ( | S const & | dir | ) | [inline, explicit] |
Constructs a scope instance and changes to the given directory.
dir | The name of the directory to change the current directory to |
References unixstl::c_str_ptr(), and stlsoft_ns_qual.
~basic_current_directory_scope | ( | ) | throw () |
Returns the current directory to its original location.
char_type const* get_previous | ( | ) | const |
Returns a C-string pointer to the original directory.
Referenced by unixstl::c_str_data(), unixstl::c_str_len(), unixstl::c_str_ptr(), and unixstl::c_str_ptr_null().
operator char_type const * | ( | ) | const |
Returns a C-string pointer to the original directory.
operator operator_bool_type | ( | ) | const [inline] |
Indicates whether the construction was successful.
true | The scope instance was successfully constructed and the current directory changed as per the constructor argument | |
false | The scope instance was not successfully constructed, and the current directory was unchanged. |