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/PathChanger.h"
15 // undef PathChanger macro when building PathChanger
22 PathChanger::PathChanger(FileName const & path)
26 pushedDir_ = FileName::getcwd();
28 if (pushedDir_.empty() || !path.chdir()) {
37 PathChanger::~PathChanger()
44 int PathChanger::pop()
47 // should throw an exception
48 // throw logical_error();
52 if (!pushedDir_.chdir()) {
53 // should throw an exception
54 // throw DirChangeError();
61 } // namespace support
65 #define PathChanger(x) unnamed_PathChanger;
67 // in merged builds this is not the last line.