Changeset 28

Show
Ignore:
Timestamp:
11/04/07 13:33:00 (10 months ago)
Author:
vramesh2
Message:

moved files

Files:

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 
    32 
    43#include "vowfs.hxx" 
    54 
    6 namespace VoWFS{ 
    7         class Dir{ 
     5namespace vowfs 
     6
     7   class dir 
     8   { 
    89 
    9        friend class Database; 
     10      friend class database; 
    1011 
    11        private
    12                static int Database db; 
     12      private
     13         database db; 
    1314 
    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; 
    1718 
    18                 string directory_path; 
    19                  
    20                 long start_time; 
    21                 long end_time; 
     19         string directory_path; 
    2220 
    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; 
    3023 
    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; 
    3931 
    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         }; 
    4241 
    43         public: 
    44                 Dir(); 
    45                 Dir(Databse _db):db(_db){} 
     42         static int NUM_FIELDS; 
     43         static PQformat pq_format; 
    4644 
    47                 Dir(PQresult *pq_data, int row); 
     45   public : 
     46      dir (); 
     47      dir ( databse _db ) : 
     48         db ( _db ) 
     49      { 
     50      } 
    4851 
    49                 int revisionId(){ 
    50                         return revision_id; 
    51                 } 
     52      dir ( PQresult *pq_data, int row ); 
    5253 
    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      } 
    6058 
    61                 File parentDir(){ 
    62                         return db.getDir(parent_dir_id); 
    63                 } 
     59      int dir_id () 
     60      { 
     61         return dir_id; 
     62      } 
    6463 
    65                 int startTime(){ 
    66                         return start_time; 
    67                 } 
     64      int parent_dir_id () 
     65      { 
     66         return parent_dir_id; 
     67      } 
    6868 
    69                 int endTime(){ 
    70                         return end_time; 
    71                 } 
     69      file parent_dir () 
     70      { 
     71         return db.get_dir ( parent_dir_id ); 
     72      } 
    7273 
    73                 string directoryPath(){ 
    74                         return directory_path; 
    75                 } 
     74      int start_time () 
     75      { 
     76         return start_time; 
     77      } 
    7678 
    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   }; 
    88100}; 
    89101 
    90102#endif 
    91