Changeset 28
- Timestamp:
- 11/04/07 13:33:00 (10 months ago)
- Files:
-
- vowfs/db.cxx (deleted)
- vowfs/db.hxx (deleted)
- vowfs/dir.cxx (deleted)
- vowfs/dir.h (moved) (moved from vowfs/dir.hxx) (1 diff)
- vowfs/file.cpp (moved) (moved from vowfs/file.cxx)
- vowfs/file.h (moved) (moved from vowfs/file.hxx)
- vowfs/vowfs.hxx (deleted)
- vowfs/xdelta.hxx (deleted)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
vowfs/dir.h
r27 r28 1 #ifndef _VoWFS_Directory_Header_ 2 #define _VoWFS_Directory_Header_ 1 #pragma one 3 2 4 3 #include "vowfs.hxx" 5 4 6 namespace VoWFS{ 7 class Dir{ 5 namespace vowfs 6 { 7 class dir 8 { 8 9 9 friend class Database;10 friend class database; 10 11 11 private:12 static int Database db;12 private : 13 database db; 13 14 14 int revision_id;15 int dir_id;16 int parent_dir_id;15 int revision_id; 16 int dir_id; 17 int parent_dir_id; 17 18 18 string directory_path; 19 20 long start_time; 21 long end_time; 19 string directory_path; 22 20 23 /* As with File's data, when the class is first constructed, 24 * dir_list and file_list are empty. However, when either 25 * listContents is called, a connection is made to the databse 26 * and dir_list, and file_list are filled. 27 */ 28 list<File> file_list; 29 list<Dir> dir_list; 21 long start_time; 22 long end_time; 30 23 31 struct PQformat{ 32 int revision_id; 33 int dir_id; 34 int parent_dir_id; 35 int directory_path; 36 int start_time; 37 int end_time; 38 }; 24 /* As with File's data, when the class is first constructed, 25 * dir_list and file_list are empty. However, when either 26 * listContents is called, a connection is made to the databse 27 * and dir_list, and file_list are filled. 28 */ 29 list < file > file_list; 30 list < dir > dir_list; 39 31 40 static int NUM_FIELDS; 41 static PQformat pq_format; 32 struct PQformat 33 { 34 int revision_id; 35 int dir_id; 36 int parent_dir_id; 37 int directory_path; 38 int start_time; 39 int end_time; 40 }; 42 41 43 public: 44 Dir(); 45 Dir(Databse _db):db(_db){} 42 static int NUM_FIELDS; 43 static PQformat pq_format; 46 44 47 Dir(PQresult *pq_data, int row); 45 public : 46 dir (); 47 dir ( databse _db ) : 48 db ( _db ) 49 { 50 } 48 51 49 int revisionId(){ 50 return revision_id; 51 } 52 dir ( PQresult *pq_data, int row ); 52 53 53 int dirId(){ 54 return dir_id; 55 } 56 57 int parentDirId(){ 58 return parent_dir_id; 59 } 54 int revision_id () 55 { 56 return revision_id; 57 } 60 58 61 File parentDir(){ 62 return db.getDir(parent_dir_id); 63 } 59 int dir_id () 60 { 61 return dir_id; 62 } 64 63 65 int startTime(){ 66 return start_time; 67 } 64 int parent_dir_id () 65 { 66 return parent_dir_id; 67 } 68 68 69 int endTime(){ 70 return end_time; 71 } 69 file parent_dir () 70 { 71 return db.get_dir ( parent_dir_id ); 72 } 72 73 73 string directoryPath(){ 74 return directory_path; 75 } 74 int start_time () 75 { 76 return start_time; 77 } 76 78 77 list<File> listFileContents(){ 78 // TODO: What is the Query for Files 79 return file_list=db.getFiles(""); 80 } 81 82 83 list<File> listDirContents(){ 84 // TODO: What is the Query for Directories 85 return dir_list=db.getDirs(""); 86 } 87 }; 79 int end_time () 80 { 81 return end_time; 82 } 83 84 string directory_path () 85 { 86 return directory_path; 87 } 88 89 list < File > list_file_contents () 90 { 91 // TODO: What is the Query for Files 92 return file_list=db.getFiles(""); 93 } 94 95 list<File> listDirContents(){ 96 // TODO: What is the Query for Directories 97 return dir_list=db.getDirs(""); 98 } 99 }; 88 100 }; 89 101 90 102 #endif 91
