using support::FileName;
using support::fileSearch;
using support::i18nLibFileSearch;
-using support::isDirWriteable;
-using support::isFileReadable;
-using support::isStrInt;
-using support::makeAbsPath;
using support::makeDisplayPath;
+using support::makeAbsPath;
using support::package;
using support::quoteName;
using support::rtrim;
}
}
else if (name == "latexlog")
- enable = isFileReadable(FileName(buf->getLogName().second));
+ enable = FileName(buf->getLogName().second).isFileReadable();
else if (name == "spellchecker")
#if defined (USE_ASPELL) || defined (USE_ISPELL) || defined (USE_PSPELL)
enable = !buf->isReadonly();
FileName const filename(makeAbsPath(target_name,
lyx_view_->buffer()->filePath()));
FileName const dvifile(makeAbsPath(dviname, path));
- if (fs::exists(filename.toFilesystemEncoding())) {
+ if (filename.exists()) {
docstring text = bformat(
_("The file %1$s already exists.\n\n"
"Do you want to overwrite that file?"),
if (lyx_view_->buffer()) {
string const trypath = lyx_view_->buffer()->filePath();
// If directory is writeable, use this as default.
- if (isDirWriteable(FileName(trypath)))
+ if (FileName(trypath).isDirWritable())
initpath = trypath;
}
filename = addName(lyxrc.document_path,
"newfile" + convert<string>(++newfile_number) + ".lyx");
while (theBufferList().exists(filename) ||
- fs::is_readable(FileName(filename).toFilesystemEncoding())) {
+ FileName(filename).isReadable()) {
++newfile_number;
filename = addName(lyxrc.document_path,
"newfile" + convert<string>(newfile_number) +
if (lyx_view_->buffer()) {
string const trypath = lyx_view_->buffer()->filePath();
// If directory is writeable, use this as default.
- if (isDirWriteable(FileName(trypath)))
+ if (FileName(trypath).isDirWritable())
initpath = trypath;
}
filename = fullname.absFilename();
// if the file doesn't exist, let the user create one
- if (!fs::exists(fullname.toFilesystemEncoding())) {
+ if (!fullname.exists()) {
// the user specifically chose this name. Believe him.
Buffer * const b = newFile(filename, string(), true);
if (b)
if (lyx_view_->buffer()) {
string const trypath = lyx_view_->buffer()->filePath();
// If directory is writeable, use this as default.
- if (isDirWriteable(FileName(trypath)))
+ if (FileName(trypath).isDirWritable())
initpath = trypath;
}
// if the file exists already, and we didn't do
// -i lyx thefile.lyx, warn
- if (fs::exists(lyxfile.toFilesystemEncoding()) && fullname != lyxfile) {
+ if (lyxfile.exists() && fullname != lyxfile) {
docstring const file = makeDisplayPath(lyxfile.absFilename(), 30);
docstring text = bformat(_("The document %1$s already exists.\n\n"
case LyXRC::RC_DISPLAY_GRAPHICS:
case LyXRC::RC_DOCUMENTPATH:
if (lyxrc_orig.document_path != lyxrc_new.document_path) {
- string const encoded = FileName(
- lyxrc_new.document_path).toFilesystemEncoding();
- if (fs::exists(encoded) && fs::is_directory(encoded))
+ FileName path(lyxrc_new.document_path);
+ if (path.exists() && path.isDirectory())
support::package().document_dir() = FileName(lyxrc.document_path);
}
case LyXRC::RC_ESC_CHARS: