]> git.lyx.org Git - features.git/blobdiff - src/support/filetools.C
Nuked the SpaceLess function. Read ChangeLog.
[features.git] / src / support / filetools.C
index e29bbcdd02eba81e37ace3281cdf6753aa687057..28268b7258adc472e6b3d8d00bbd04199cb2cf65 100644 (file)
@@ -26,6 +26,7 @@ using std::pair;
 #endif
 
 #include "filetools.h"
+#include "LSubstring.h"
 #include "lyx_gui_misc.h"
 #include "FileInfo.h"
 #include "support/path.h"        // I know it's OS/2 specific (SMiyata)
@@ -70,7 +71,7 @@ bool IsSGMLFilename(string const & filename)
 
 
 // Substitutes spaces with underscores in filename (and path)
-string SpaceLess(string const & file)
+string MakeLatexName(string const & file)
 {
        string name = OnlyFilename(file);
        string path = OnlyPath(file);
@@ -91,6 +92,18 @@ string SpaceLess(string const & file)
        return AddName(path, name);
 }
 
+// Substitutes spaces with underscores in filename (and path)
+string QuoteName(string const & name)
+{
+#ifdef WITH_WARNINGS
+#warning Add proper emx support here!
+#endif
+       string qname = name;
+       while (qname.find("'") != string::npos) 
+         LSubstring(qname,"'") = "\\'";
+       return '\'' + qname + '\'';
+}
+
 
 /// Returns an unique name to be used as a temporary file. 
 string TmpFileName(string const & dir, string const & mask)