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"
22 * Path - utility closs for stackable working directories
24 * You can use a local variable of this type to temporarily
25 * change to a directory as the cwd, for example :
28 * FileName pp("/tmp/blah");
33 * At the end of p's scope the cwd is reset to its previous value.
37 /// change to the given directory
38 explicit PathChanger(FileName const & path);
40 /// set cwd to the previous value if needed
43 /// set cwd to the previous value if needed
47 PathChanger(PathChanger const &);
48 void operator=(PathChanger const &);
50 /// whether we are in the new cwd or not
56 // To avoid the wrong usage:
57 // PathChanger("/tmp"); // wrong
58 // PathChanger p("/tmp"); // right
60 #define PathChanger(x) unnamed_PathChanger;
61 // Tip gotten from Bobby Schmidt's column in C/C++ Users Journal
63 } // namespace support