4 * This file is part of LyX, the document processor.
5 * Licence details can be found in the file COPYING.
7 * \author Lars Gullik Bjønnes
9 * Full author contact details are available in file CREDITS.
15 #include "support/FileName.h"
17 #include <boost/noncopyable.hpp>
25 * Path - utility closs for stackable working directories
27 * You can use a local variable of this type to temporarily
28 * change to a directory as the cwd, for example :
31 * Path p("/tmp/blah");
35 * At the end of p's scope the cwd is reset to its previous value.
37 class Path : boost::noncopyable {
39 /// change to the given directory
40 explicit Path(FileName const & path);
42 /// set cwd to the previous value if needed
45 /// set cwd to the previous value if needed
48 /// whether we are in the new cwd or not
54 // To avoid the wrong usage:
55 // Path("/tmp"); // wrong
56 // Path p("/tmp"); // right
59 // With boost 1.34 this is not usable anymore
61 //#define Path(x) unnamed_Path;
63 // Tip gotten from Bobby Schmidt's column in C/C++ Users Journal
65 } // namespace support