6 //#include "filetools.h"
8 #include <boost/utility.hpp>
15 class Path : boost::noncopyable {
19 Path(string const & path)
23 pushedDir_ = lyx::getcwd(); // GetCWD();
24 if (pushedDir_.empty() || lyx::chdir(path)) {
25 // should throw an exception
26 // throw DirChangeError();
27 // The use of WriteFSAlert makes this
28 // impossible to inline.
29 //WriteFSAlert(_("Error: Could not change to directory: "),
50 // To avoid the wrong usage:
51 // Path("/tmp"); // wrong
52 // Path p("/tmp"); // right
55 #define Path(x) unnamed_Path;
56 // Tip gotten from Bobby Schmidt's column in C/C++ Users Journal