#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 {
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)
*/
LYXERR(Debug::FILES, "createTmpDir: tempdir=`" << tempdir << "'\n"
<< "createTmpDir: mask=`" << mask << '\'');
- FileName const tmpfl(tempName(tempdir, mask));
- // lyx::tempName actually creates a file to make sure that it
+ FileName const tmpfl = FileName::tempName(tempdir, mask);
+ // FileName::tempName actually creates a file to make sure that it
// stays unique. So we have to delete it before we can create
// a dir with the same name. Note also that we are not thread
// safe because of the gap between unlink and mkdir. (Lgb)
tmpfl.removeFile();
- if (tmpfl.empty() || mkdir(tmpfl, 0700)) {
+ if (tmpfl.empty() || !tmpfl.createDirectory(0700)) {
lyxerr << "LyX could not create the temporary directory '"
<< tmpfl << "'" << endl;
return FileName();
package().temp_dir().absFilename() + "/lyx_tmpbuf" +
convert<string>(count++);
- if (mkdir(FileName(tmpfl), 0777)) {
+ if (!FileName(tmpfl).createDirectory(0777)) {
lyxerr << "LyX could not create the temporary directory '"
<< tmpfl << "'" << endl;
return string();
if (deflt.empty() || deflt.absFilename() == "/tmp")
return createTmpDir(FileName("/tmp"), "lyx_tmpdir");
- if (!mkdir(deflt, 0777))
+ if (deflt.createDirectory(0777))
return deflt;
if (deflt.isDirWritable()) {
static boost::regex bbox_re(
"^%%BoundingBox:\\s*([[:digit:]]+)\\s+([[:digit:]]+)\\s+([[:digit:]]+)\\s+([[:digit:]]+)");
- std::ifstream is(file_.toFilesystemEncoding().c_str());
+ ifstream is(file_.toFilesystemEncoding().c_str());
while (is) {
string s;
getline(is,s);
return cmp;
}
+
} //namespace support
} // namespace lyx