]> git.lyx.org Git - lyx.git/blobdiff - src/support/os_cygwin.cpp
abdel likes short code
[lyx.git] / src / support / os_cygwin.cpp
index 304dd3e9975de715bb2476bf77469e13bd384d71..cfaeb549f6330277b3de6e5b0b2c50c06bdc3530 100644 (file)
 #include <config.h>
 
 #include "support/os.h"
-#include "support/lstrings.h"
 
-#include "debug.h"
+#include "support/FileName.h"
+#include "support/lstrings.h"
+#include "support/debug.h"
 
 #include <windows.h>
 #include <io.h>
 
 #include <sys/cygwin.h>
 
-using std::endl;
-using std::string;
-
-using lyx::support::contains;
-
+using namespace std;
 
 namespace lyx {
 namespace support {
@@ -191,12 +188,10 @@ string latex_path(string const & p)
        // on windows_style_tex_paths_), but we use always forward slashes,
        // since it gets written into a .tex file.
 
-       if (windows_style_tex_paths_ && is_absolute_path(p)) {
+       if (windows_style_tex_paths_ && FileName(p).isAbsolute()) {
                string dos_path = convert_path(p, PathStyle(windows));
-               LYXERR(Debug::LATEX)
-                       << "<Path correction for LaTeX> ["
-                       << p << "]->>["
-                       << dos_path << ']' << endl;
+               LYXERR(Debug::LATEX, "<Path correction for LaTeX> ["
+                       << p << "]->>[" << dos_path << ']');
                return dos_path;
        }
 
@@ -204,18 +199,6 @@ string latex_path(string const & p)
 }
 
 
-bool is_absolute_path(string const & p)
-{
-       if (p.empty())
-               return false;
-
-       bool isDosPath = (p.length() > 1 && p[1] == ':');
-       bool isUnixPath = (p[0] == '/');
-
-       return isDosPath || isUnixPath;
-}
-
-
 // returns a string suitable to be passed to popen when
 // reading a pipe
 char const * popen_read_mode()