3 * This file is part of LyX, the document processor.
4 * Licence details can be found in the file COPYING.
6 * \author Lars Gullik Bjønnes
8 * Full author contact details are available in file CREDITS.
13 #include "support/Path.h"
14 #include "support/lyxlib.h"
16 // undef PathChanger macro when building PathChanger
23 PathChanger::PathChanger(FileName const & path)
27 pushedDir_ = getcwd();
29 if (pushedDir_.empty() || !path.chdir()) {
38 PathChanger::~PathChanger()
45 int PathChanger::pop()
48 // should throw an exception
49 // throw logical_error();
53 if (!pushedDir_.chdir()) {
54 // should throw an exception
55 // throw DirChangeError();
62 } // namespace support
66 #define PathChanger(x) unnamed_PathChanger;
67 // in merged builds this is not the last line.