|
SlHelpers
|
Change to a directory while this object lives, then change back. More...
#include <PushD.h>
Public Member Functions | |
| PushD (const std::filesystem::path &dir, std::error_code &ec) | |
Change to directory dir. More... | |
| PushD (const std::filesystem::path &dir) | |
Change to directory dir and throw an exception on error. More... | |
Change to a directory while this object lives, then change back.
|
inline |
Change to directory dir.
| dir | Directory to cd to |
| ec | Error code if something failed |
When the destructor is called, it is cd-ed back to the original directory (the current directory before the call to constructor).
|
inline |
Change to directory dir and throw an exception on error.
| dir | Directory to cd to |
When the destructor is called, it is cd-ed back to the original directory (the current directory before the call to constructor).