BioInt  1.02.00
BioInt: An integrative biological object-oriented application framework and interpreter
BioDatabase.h
Go to the documentation of this file.
00001 #ifndef BIODATABASE_H
00002 #define BIODATABASE_H
00003 
00004 #include<string>
00005 #include<vector>
00006 #include<iostream>
00007 #include<fstream>
00008 #include <cstdio>
00009 #include <cstdlib>
00010 
00011 using namespace std;
00012 
00013 class BioDatabase
00014 {
00015        friend bool operator >(const BioDatabase& , const BioDatabase&);
00016        friend bool operator <(const BioDatabase& , const BioDatabase&);
00017        friend bool operator ==(const BioDatabase& , const BioDatabase&);
00018 
00019         vector<string> fileNames_,dirNames_;
00020         string dirPath_,ext_;
00021         int flag;
00022         
00023 void retrieveFiles(BioDatabase &bd, int n, ostream & = cout,string ext= "*");
00024         void retrieveDirs(BioDatabase &bd, int n, vector <string> & vst);
00025         void retrieveDirs(BioDatabase &bd, int n, ostream & = cout);
00026         void retrieveDirs(BioDatabase &bd, int n, int & cnt);
00027         string getFullPath(const string & st);
00028 
00029 public :
00030    BioDatabase();
00031    BioDatabase(string directoryName ,string extension ="*");
00032    
00033    void changeDirectory(string diretoryName = "NULL",string extension = "*");
00034    void refresh(); 
00035 
00036    bool findFile(string fn = "NULL");
00037    bool findSubDirectory(string dn = "NULL");
00038 
00039 //   bool findFileRecursively(string fn = "NULL");
00040 //   bool findSubDirectoryRecursively(string dn = "NULL");
00041    
00042    bool createDirectory(string  directoryName);
00043    bool removeDirectory(string  directoryName);
00044    bool removeFile(string  fileName);
00045    bool renameFile(string  fn1, string fn2);
00046    bool copyFile(string  fn1, string fn2);
00047 
00048    string getFile(unsigned int index);
00049 //   vector <string> getFileListRecursively();
00050    vector <string> getSubDirectoryListRecursively();
00051    int getNumberOfSubDirectoryListRecursively();
00052 
00053    string getCurrentDirectory();
00054    string getSubDirectory(unsigned int index);
00055 
00056    string getFileWithFullPath(unsigned int index);
00057    long getFileIndex(const string & st);
00058    long getSubDirectoryIndex(const string & st);
00059    string getSubDirectoryWithFullPath(unsigned int index);
00060    long getNumberOfFiles();
00061    long getNumberOfSubDirectories();
00062 
00063    void showFileList(ostream & os = cout); 
00064    void showSubDirectoryList(ostream & os = cout); 
00065    
00066    void showFileListRecursively(ostream & os = cout); 
00067    void showSubDirectoryListRecursively(ostream & os = cout); 
00068 
00069 };
00070 
00071 #endif
 All Classes Files Functions Variables Typedefs Enumerations Enumerator Friends Defines