]> git.lyx.org Git - lyx.git/blobdiff - src/support/FileInfo.h
one small private fix in mathed, put noncopyable and tie into boost namespace
[lyx.git] / src / support / FileInfo.h
index 93bbadc8fb860525800ed0831f709cd0b1a032db..41063a9ba5b740c182027375b95fb002d8a83b9e 100644 (file)
 
 #include <ctime>
 
-#include <unistd.h>
 #include <sys/types.h>
 #include <sys/stat.h>
-
+#include <unistd.h>
+#include <boost/utility.hpp>
 #include "LString.h"
 
 /** Use objects of this class to get information about files.
  */
-class FileInfo {
+class FileInfo : public boost::noncopyable {
 public:
        ///
        FileInfo();
@@ -101,15 +101,15 @@ public:
                eperm = F_OK
        };
        /// Test whether the current user has a given set of permissions
-       bool access(int p);
+       bool access(int p) const;
        /// Is the file writable for the current user?
-       bool writable() { return access(FileInfo::wperm); }
+       bool writable() const { return access(FileInfo::wperm); }
        /// Is the file readable for the current user?
-       bool readable() { return access(FileInfo::rperm); }
+       bool readable() const { return access(FileInfo::rperm); }
        /// Is the file executable for the current user?
-       bool executable() { return access(FileInfo::xperm); }
+       bool executable() const { return access(FileInfo::xperm); }
        /// Does the file exist?
-       bool exist() { return access(FileInfo::eperm); }
+       bool exist() const { return access(FileInfo::eperm); }
        ///
        bool isLink() const;
        ///