create FileName::isDir function

git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@21046 a592a061-630c-0410-9148-cb99ea01b6c8
This commit is contained in:
André Pönitz 2007-10-18 19:38:24 +00:00
parent 0f939f0a79
commit 055c95ca51
2 changed files with 8 additions and 0 deletions

View File

@ -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_));

View File

@ -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.