X-Git-Url: http://git.home-dn.net/?p=manu%2Fsuphp.git;a=blobdiff_plain;f=src%2FFile.hpp;h=f30431cdaf2c9e63df2be443f71e2f842c41e06d;hp=3268fb7b7efb6eae5c45d9d7b150a7b1b4d48675;hb=849f4a7977b5780eacae8fad7a078d05f4a615ee;hpb=b0eaa3f1fbf491fdc8a3044cf20754f14254338a diff --git a/src/File.hpp b/src/File.hpp index 3268fb7..f30431c 100644 --- a/src/File.hpp +++ b/src/File.hpp @@ -1,5 +1,5 @@ /* - suPHP - (c)2002-2005 Sebastian Marsching + suPHP - (c)2002-2008 Sebastian Marsching This file is part of suPHP. @@ -24,15 +24,15 @@ namespace suPHP { class File; enum FileMode { - FILEMODE_USER_READ, - FILEMODE_USER_WRITE, - FILEMODE_USER_EXEC, - FILEMODE_GROUP_READ, - FILEMODE_GROUP_WRITE, - FILEMODE_GROUP_EXEC, - FILEMODE_OTHERS_READ, - FILEMODE_OTHERS_WRITE, - FILEMODE_OTHERS_EXEC + FILEMODE_USER_READ, + FILEMODE_USER_WRITE, + FILEMODE_USER_EXEC, + FILEMODE_GROUP_READ, + FILEMODE_GROUP_WRITE, + FILEMODE_GROUP_EXEC, + FILEMODE_OTHERS_READ, + FILEMODE_OTHERS_WRITE, + FILEMODE_OTHERS_EXEC }; }; @@ -55,95 +55,99 @@ namespace suPHP { */ class File { private: - std::string path; - bool hasPermissionBit(FileMode perm) const throw (SystemException); - + std::string path; + bool hasPermissionBit(FileMode perm) const throw (SystemException); + public: - /** - * Constructor - */ - File(std::string path); - - /** - * Returns path to file - */ - std::string getPath() const; - - /** - * Returns input stream to read from file - */ - SmartPtr getInputStream() throw (IOException); - - /** - * Does file exists? - */ - bool exists() const; - - /** - * Returns real path to file (without symlinks in path) - */ - std::string getRealPath() const throw (SystemException); - - /** - * Returns File object representing parent directory - */ - File getParentDirectory() const; - - /** - * Returns permission bit - */ - bool hasUserReadBit() const throw (SystemException); - - /** - * Returns permission bit - */ - bool hasUserWriteBit() const throw (SystemException); - - /** - * Returns permission bit - */ - bool hasUserExecuteBit() const throw (SystemException); - - /** - * Returns permission bit - */ - bool hasGroupReadBit() const throw (SystemException); - - /** - * Returns permission bit - */ - bool hasGroupWriteBit() const throw (SystemException); - - /** - * Returns permission bit - */ - bool hasGroupExecuteBit() const throw (SystemException); - - /** - * Returns permission bit - */ - bool hasOthersReadBit() const throw (SystemException); - - /** - * Returns permission bit - */ - bool hasOthersWriteBit() const throw (SystemException); - - /** - * Returns permission bit - */ - bool hasOthersExecuteBit() const throw (SystemException); - - /** - * Returns owner (user) of file - */ - UserInfo getUser() const throw (SystemException); - - /** - * Returns owning group of file - */ - GroupInfo getGroup() const throw (SystemException); - + /** + * Constructor + */ + File(std::string path); + + /** + * Returns path to file + */ + std::string getPath() const; + + /** + * Returns input stream to read from file + */ + SmartPtr getInputStream() const throw (IOException); + + /** + * Does file exists? + */ + bool exists() const; + + /** + * Returns real path to file (without symlinks in path) + */ + std::string getRealPath() const throw (SystemException); + + /** + * Returns File object representing parent directory + */ + File getParentDirectory() const; + + /** + * Returns permission bit + */ + bool hasUserReadBit() const throw (SystemException); + + /** + * Returns permission bit + */ + bool hasUserWriteBit() const throw (SystemException); + + /** + * Returns permission bit + */ + bool hasUserExecuteBit() const throw (SystemException); + + /** + * Returns permission bit + */ + bool hasGroupReadBit() const throw (SystemException); + + /** + * Returns permission bit + */ + bool hasGroupWriteBit() const throw (SystemException); + + /** + * Returns permission bit + */ + bool hasGroupExecuteBit() const throw (SystemException); + + /** + * Returns permission bit + */ + bool hasOthersReadBit() const throw (SystemException); + + /** + * Returns permission bit + */ + bool hasOthersWriteBit() const throw (SystemException); + + /** + * Returns permission bit + */ + bool hasOthersExecuteBit() const throw (SystemException); + + /** + * Returns owner (user) of file + */ + UserInfo getUser() const throw (SystemException); + + /** + * Returns owning group of file + */ + GroupInfo getGroup() const throw (SystemException); + + /** + * Checks whether this file is a symlink + */ + bool isSymlink() const throw (SystemException); }; };