10 // Construct a FileData object with default values
22 char getFileType() const { return filetype; }
23 const std::string &getPermissions() const { return permissions; }
24 const std::string &getUserName() const { return username; }
25 const std::string &getGroupName() const { return groupname; }
26 unsigned long long getFileSize() const { return filesize; }
27 unsigned long long getModifiedDate() const { return modified_date; }
28 const std::string &getFileName() const { return filename; }
29 unsigned long long getLastBackupDate() const { return last_backup_date; }
31 void setFileType( char arg ) { filetype = arg; }
32 void setPermissions( const std::string &arg ) { permissions = arg; }
33 void setUserName( const std::string &arg ) { username = arg; }
34 void setGroupName( const std::string &arg ) { groupname = arg; }
35 void setFileSize( unsigned long long arg ) { filesize = arg; }
36 void setModifiedDate( unsigned long long arg ) { modified_date = arg; }
37 void setFileName( const std::string &arg ) { filename = arg; }
38 void setLastBackupDate( unsigned long long arg ) { last_backup_date = arg; }
41 FileData( const FileData & );
44 std::string permissions;
46 std::string groupname;
47 unsigned long long filesize;
48 unsigned long long modified_date;
49 unsigned long long last_backup_date;
53 std::ostream &operator<<( const FileData *d, std::ostream &o );
54 std::istream &operator>>( std::istream &i, FileData *d );
56 std::ostream &operator<<( const FileData &d, std::ostream &o );
57 std::istream &operator>>( std::istream &i, FileData &d );
59 struct FileDataLastBackupCmp {
60 bool operator()( const FileData *a, const FileData *b ) {
61 return a->getLastBackupDate() < b->getLastBackupDate();
65 struct FileDataSizeCmp {
66 bool operator()( const FileData *a, const FileData *b ) {
67 return a->getFileSize() < b->getFileSize();
71 struct FileDataNameCmp {
72 bool operator()( const FileData *a, const FileData *b ) {
73 return cmp( a->getFileName(), b->getFileName() );
76 std::less<std::string> cmp;
79 typedef std::set<FileData*,FileDataNameCmp> file_set;
80 typedef std::vector<FileData*> file_vector;