BESCatalogUtils.h
Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031
00032
00033 #ifndef S_BESCatalogUtils_h
00034 #define S_BESCatalogUtils_h 1
00035
00036 #include <map>
00037 #include <list>
00038 #include <string>
00039
00040 using std::map ;
00041 using std::list ;
00042 using std::string ;
00043
00044 #include "BESObj.h"
00045 #include "BESUtil.h"
00046
00047 class BESCatalogUtils : public BESObj
00048 {
00049 private:
00050 static map<string, BESCatalogUtils *> _instances ;
00051
00052 string _root_dir ;
00053 list<string> _exclude ;
00054 list<string> _include ;
00055 bool _follow_syms ;
00056
00057 public:
00058 struct type_reg
00059 {
00060 string type ;
00061 string reg ;
00062 } ;
00063
00064 private:
00065 list< type_reg > _match_list ;
00066
00067 BESCatalogUtils() {}
00068 public:
00069 BESCatalogUtils( const string &name ) ;
00070 virtual ~BESCatalogUtils() {}
00071 const string & get_root_dir() const { return _root_dir ; }
00072 bool follow_sym_links() const { return _follow_syms ; }
00073 virtual bool include( const string &inQuestion ) const ;
00074 virtual bool exclude( const string &inQuestion ) const ;
00075
00076 typedef list< type_reg >::const_iterator match_citer ;
00077 BESCatalogUtils::match_citer match_list_begin() const ;
00078 BESCatalogUtils::match_citer match_list_end() const ;
00079
00080 virtual void dump( ostream &strm ) const ;
00081
00082 static const BESCatalogUtils *Utils( const string &name ) ;
00083 } ;
00084
00085 #endif // S_BESCatalogUtils_h
00086