From 055c95ca51aa81efa450a990c2d82e38cd1b7075 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andr=C3=A9=20P=C3=B6nitz?= Date: Thu, 18 Oct 2007 19:38:24 +0000 Subject: [PATCH] create FileName::isDir function git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@21046 a592a061-630c-0410-9148-cb99ea01b6c8 --- src/support/FileName.cpp | 6 ++++++ src/support/FileName.h | 2 ++ 2 files changed, 8 insertions(+) diff --git a/src/support/FileName.cpp b/src/support/FileName.cpp index 606299ec11..18a910284d 100644 --- a/src/support/FileName.cpp +++ b/src/support/FileName.cpp @@ -87,6 +87,12 @@ bool FileName::exists() const } +bool FileName::isDir() const +{ + return QFileInfo(toqstr(name_)).isDir(); +} + + bool FileName::isReadOnly() const { QFileInfo const fi(toqstr(name_)); diff --git a/src/support/FileName.h b/src/support/FileName.h index e5059b24e4..77f5c32d87 100644 --- a/src/support/FileName.h +++ b/src/support/FileName.h @@ -59,6 +59,8 @@ public: std::time_t lastModified() const; /// return true when file is readable but not writabel bool isReadOnly() const; + /// return true when it names a directory + bool isDir() const; /** * Get a FileName from \p name in the encoding used by the file system.