#include <config.h>
+#include "support/filetools.h"
+
#include "support/convert.h"
+#include "support/debug.h"
#include "support/environment.h"
-#include "support/filetools.h"
+#include "support/gettext.h"
#include "support/lstrings.h"
#include "support/lyxlib.h"
#include "support/os.h"
#include "support/Package.h"
#include "support/Path.h"
#include "support/Systemcall.h"
+#include "support/qstring_helpers.h"
-// FIXME Interface violation
-#include "gettext.h"
-#include "debug.h"
+#include <QDir>
#include <boost/assert.hpp>
#include <boost/regex.hpp>
#include <fstream>
#include <sstream>
-using std::endl;
-using std::getline;
-using std::make_pair;
-using std::string;
-using std::ifstream;
-using std::ostringstream;
-using std::vector;
-using std::pair;
+using namespace std;
namespace lyx {
namespace support {
// Substitutes spaces with underscores in filename (and path)
-string const makeLatexName(string const & file)
+FileName const makeLatexName(FileName const & file)
{
- string name = onlyFilename(file);
- string const path = onlyPath(file);
+ string name = file.onlyFileName();
+ string const path = file.onlyPath().absFilename() + "/";
// ok so we scan through the string twice, but who cares.
+ // FIXME: in Unicode time this will break for sure! There is
+ // a non-latin world out there...
string const keep = "abcdefghijklmnopqrstuvwxyz"
"ABCDEFGHIJKLMNOPQRSTUVWXYZ"
"@!'()*+,-./0123456789:;<=>?[]`|";
while ((pos = name.find_first_not_of(keep, pos)) != string::npos)
name[pos++] = '_';
- return addName(path, name);
+ FileName latex_name(path + name);
+ latex_name.changeExtension(".tex");
+ return latex_name;
}
variable. But we don't use the value if the currently
selected locale is the C locale. This is a GNU extension.
- Otherwise, w use a trick to guess what gettext has done:
+ Otherwise, w use a trick to guess what support/gettext.has done:
each po file is able to tell us its name. (JMarc)
*/
return cmp;
}
+
} //namespace support
} // namespace lyx