]> git.lyx.org Git - lyx.git/blobdiff - src/support/FileInfo.h
another safety belt
[lyx.git] / src / support / FileInfo.h
index 78a0a99575c58501cd41dffe63519f65f838194a..b83e0dc752a197815e6aaec482b64fe08e4b35d4 100644 (file)
@@ -1,13 +1,13 @@
 // -*- C++ -*-
-/* This file is part of
- * ======================================================
- * 
- *           LyX, The Document Processor
- *        
- *           Copyright 1995 Matthias Ettrich
- *           Copyright 1995-2001 The LyX Team.
+/**
+ * \file FileInfo.h
+ * This file is part of LyX, the document processor.
+ * Licence details can be found in the file COPYING.
  *
- * ====================================================== */
+ * \author Lars Gullik Bjønnes
+ *
+ * Full author contact details are available in file CREDITS
+ */
 
 #ifndef FILE_INFO_H
 #define FILE_INFO_H
 #include <boost/utility.hpp>
 #include "LString.h"
 
-#if defined(__CYGWIN__) //Cygwin has it's own concept of X_OK ???
-#undef X_OK
-#define X_OK 1
-#endif
-
 /** Use objects of this class to get information about files.
  *
  * Users must make sure to check fi.isOK() before any operations
@@ -38,65 +33,54 @@ class FileInfo : boost::noncopyable {
 public:
        ///
        FileInfo();
-       
+
        /** Get information about file.
            If link is true, the information is about the link itself, not
            the file that is obtained by tracing the links. */
-       explicit
-       FileInfo(string const & path, bool link = false);
+       explicit FileInfo(string const & path, bool link = false);
 
        /// File descriptor
-       explicit
-       FileInfo(int fildes);
+       explicit FileInfo(int fildes);
 
        /// Query a new file
        FileInfo & newFile(string const & path, bool link = false);
-       
+
        /// Query a new file descriptor
-        FileInfo & newFile(int fildes);
-       
+       FileInfo & newFile(int fildes);
+
        /// Returns a character describing file type (ls -F)
-       char const * typeIndicator() const;
-       
+       char typeIndicator() const;
+
        /// File protection mode
        mode_t getMode() const;
 
        /// Constructs standard mode string (ls style)
-       void modeString(char * szString) const;
-       
-       /// returns a letter describing a file type (ls style)
-       char typeLetter() const;
-       
-       /// builds 'rwx' string describing file access rights
-       void flagRWX(mode_t i, char * szString) const;
-       
-       /// updates mode string to match suid/sgid/sticky bits
-       void setSticky(char * szString) const;
-       
+       string modeString() const;
+
        ///
        time_t getModificationTime() const;
-       
+
        ///
        time_t getAccessTime() const;
-       
+
        ///
        time_t getStatusChangeTime() const;
-       
+
        /// Total file size in bytes
        off_t getSize() const;
-       
+
        /// Number of hard links
        nlink_t getNumberOfLinks() const;
-       
+
        /// User ID of owner
        uid_t getUid() const;
-       
+
        /// Group ID of owner
        gid_t getGid() const;
-       
+
        /// Is the file information correct? Did the query succeed?
        bool isOK() const;
-       
+
        /// Permission flags
        enum perm_test {
                /// test for read permission
@@ -144,14 +128,15 @@ private:
        void init();
        ///
        void dostat(bool);
+
        ///
-       struct stat buf;
+       struct stat buf_;
        ///
-       int status;
+       int status_;
        ///
-       int err;
+       int err_;
        ///
-       string fname;
+       string fname_;
 };
 
 #endif