/* */ #ifndef _D_FILE_H_ #define _D_FILE_H_ #include "common.h" #include using namespace std; /** * Represents file and directory */ class File { private: string name; int fillStat(struct stat& fstat); public: File(const string& name); ~File(); /** * Tests whether the file or directory denoted by name exists. */ bool exists(); /** * Tests whether the file denoted by name is a regular file. */ bool isFile(); /** * Tests whether the file denoted by name is a directory. */ bool isDir(); /** * Deletes the file or directory denoted by name. * If name denotes a directory, it must be empty in order to delete. */ bool remove(); long long int size(); }; #endif // _D_FILE_H_