24 PushD(
const std::filesystem::path &dir, std::error_code &ec) {
25 origDir = std::filesystem::current_path(ec);
27 std::filesystem::current_path(dir, ec);
37 PushD(
const std::filesystem::path &dir) {
38 origDir = std::filesystem::current_path();
39 std::filesystem::current_path(dir);
41 ~PushD() { std::filesystem::current_path(origDir); }
43 std::filesystem::path origDir;
Change to a directory while this object lives, then change back.
Definition PushD.h:12
PushD(const std::filesystem::path &dir)
Change to directory dir and throw an exception on error.
Definition PushD.h:37
PushD(const std::filesystem::path &dir, std::error_code &ec)
Change to directory dir.
Definition PushD.h:24