using std::endl;
namespace lyx {
+namespace support {
namespace {
} // namespace anon
-string const lyx::support::tempName(string const & dir, string const & mask)
+FileName const tempName(FileName const & dir, string const & mask)
{
- string const tmpdir(dir.empty() ? package().temp_dir() : dir);
+ // FIXME UNICODE encoding of package().temp_dir() is probably wrong
+ string const tmpdir(dir.empty() ? package().temp_dir() : dir.toFilesystemEncoding());
string tmpfl(addName(tmpdir, mask));
#if defined (HAVE_GETPID)
tmpfl += convert<string>(getpid());
#endif
lyxerr[Debug::FILES] << "Temporary file `" << t
<< "' created." << endl;
- return t;
+ return FileName(t);
} else {
lyxerr[Debug::FILES]
<< "LyX Error: Unable to create temporary file."
<< endl;
- return string();
+ return FileName();
}
}
-
+} // namespace support
} // namespace lyx