diff options
author | Josh Heidenreich <josh.sickmate@gmail.com> | 2012-03-08 09:07:16 +1030 |
---|---|---|
committer | Josh Heidenreich <josh.sickmate@gmail.com> | 2012-03-09 08:49:54 +1030 |
commit | b64352905ff5fc64e3b2d800766dcfd19b28f533 (patch) | |
tree | c4c45be078c2fd882c990287319162ea1a133d70 | |
parent | 1f36132b1995dc1e89d2b0b372f5805a9d3c5a95 (diff) |
Added FileStatus methods isFile, isDirectory, isRegular, isLink
-rw-r--r-- | sal/inc/osl/file.hxx | 54 |
1 files changed, 54 insertions, 0 deletions
diff --git a/sal/inc/osl/file.hxx b/sal/inc/osl/file.hxx index 8c977508763e..eb25e637eed8 100644 --- a/sal/inc/osl/file.hxx +++ b/sal/inc/osl/file.hxx @@ -730,6 +730,60 @@ public: return (_aStatus.uValidFields & osl_FileStatus_Mask_Type) ? (Type) _aStatus.eType : Unknown; } + /** Is it a file? + This method returns True for both regular files, and links. + + @return + True if it's a file, False otherwise. + + @see getFileType + @see isRegular + @see isLink + */ + inline sal_Bool isFile() const + { + return ( getFileType() == Regular || getFileType() == Link ); + } + + /** Is it a directory? + This method returns True for both directories, and volumes. + + @return + True if it's a directory, False otherwise. + + @see getFileType + */ + inline sal_Bool isDirectory() const + { + return ( getFileType() == Directory || getFileType() == Volume ); + } + + /** Is it a regular file? + + @return + True if it's a regular file, False otherwise. + + @see getFileType + @see isFile + @see isLink + */ + inline sal_Bool isRegular() const + { + return ( getFileType() == Regular ); + } + + /** Is it a link? + + @return + True if it's a link, False otherwise. + + @see getFileType + */ + inline sal_Bool isLink() const + { + return ( getFileType() == Link ); + } + /** Get the file attributes. @return |