]> git.lyx.org Git - lyx.git/blobdiff - src/support/path.h
split LyXText::rowlist_ into individual Paragraph::rows_ chunks
[lyx.git] / src / support / path.h
index 4b802cc14c947463bdd79536d5d38e5271d2dc32..1e71fbad88edb496dc57e9cc42672b8f11f9be12 100644 (file)
@@ -1,24 +1,23 @@
 // -*- C++ -*-
 /**
  * \file path.h
- * Copyright 1995-2002 the LyX Team
- * Read the file COPYING
+ * This file is part of LyX, the document processor.
+ * Licence details can be found in the file COPYING.
  *
- * \author unknown
+ * \author Lars Gullik Bjønnes
+ *
+ * Full author contact details are available in file CREDITS
  */
 
 #ifndef PATH_H
 #define PATH_H
 
 #include "LString.h"
-//#include "filetools.h"
 #include "lyxlib.h"
 #include <boost/utility.hpp>
 
-#ifdef __GNUG__
-#pragma interface
-#endif
-
+namespace lyx {
+namespace support {
 
 /**
  * Path - utility closs for stackable working directories
@@ -28,7 +27,7 @@
  *
  * if (blah) {
  *     Path p("/tmp/blah");
- *     ...
+ *     ...
  * }
  *
  * At the end of p's scope the cwd is reset to its previous value.
@@ -40,21 +39,21 @@ public:
        Path(string const & path)
                : popped_(false)
        {
-               if (!path.empty()) { 
-                       pushedDir_ = lyx::getcwd();
-                       if (pushedDir_.empty() || lyx::chdir(path))
+               if (!path.empty()) {
+                       pushedDir_ = getcwd();
+                       if (pushedDir_.empty() || chdir(path))
                                /* FIXME: throw */;
                } else {
                        popped_ = true;
                }
        }
+
        /// set cwd to the previous value if needed
        ~Path()
        {
                if (!popped_) pop();
        }
+
        /// set cwd to the previous value if needed
        int pop();
 private:
@@ -72,4 +71,7 @@ private:
 #define Path(x) unnamed_Path;
 // Tip gotten from Bobby Schmidt's column in C/C++ Users Journal
 
+} // namespace support
+} // namespace lyx
+
 #endif // PATH_H