OPeNDAP Hyrax Back End Server (BES)  Updated for version 3.8.3
BESCatalogUtils.h
Go to the documentation of this file.
1 // BESCatalogUtils.h
2 
3 // This file is part of bes, A C++ back-end server implementation framework
4 // for the OPeNDAP Data Access Protocol.
5 
6 // Copyright (c) 2004-2009 University Corporation for Atmospheric Research
7 // Author: Patrick West <pwest@ucar.edu> and Jose Garcia <jgarcia@ucar.edu>
8 //
9 // This library is free software; you can redistribute it and/or
10 // modify it under the terms of the GNU Lesser General Public
11 // License as published by the Free Software Foundation; either
12 // version 2.1 of the License, or (at your option) any later version.
13 //
14 // This library is distributed in the hope that it will be useful,
15 // but WITHOUT ANY WARRANTY; without even the implied warranty of
16 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
17 // Lesser General Public License for more details.
18 //
19 // You should have received a copy of the GNU Lesser General Public
20 // License along with this library; if not, write to the Free Software
21 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
22 //
23 // You can contact University Corporation for Atmospheric Research at
24 // 3080 Center Green Drive, Boulder, CO 80301
25 
26 // (c) COPYRIGHT University Corporation for Atmospheric Research 2004-2005
27 // Please read the full copyright statement in the file COPYRIGHT_UCAR.
28 //
29 // Authors:
30 // pwest Patrick West <pwest@ucar.edu>
31 // jgarcia Jose Garcia <jgarcia@ucar.edu>
32 
33 #ifndef S_BESCatalogUtils_h
34 #define S_BESCatalogUtils_h 1
35 
36 #include <map>
37 #include <vector>
38 #include <list>
39 #include <string>
40 
41 using std::map ;
42 using std::vector ;
43 using std::list ;
44 using std::string ;
45 
46 #include "BESObj.h"
47 #include "BESUtil.h"
48 
49 class BESCatalogUtils : public BESObj
50 {
51 private:
52  static map<string, BESCatalogUtils *> _instances ;
53 
54  string _root_dir ;
55  list<string> _exclude ;
56  list<string> _include ;
57  bool _follow_syms ;
58 
59 public:
60  struct type_reg
61  {
62  string type ;
63  string reg ;
64  } ;
65 
66 private:
67  vector< type_reg > _match_list ;
68 
69  BESCatalogUtils() {}
70 public:
71  BESCatalogUtils( const string &name ) ;
72  virtual ~BESCatalogUtils() {}
73  const string & get_root_dir() const { return _root_dir ; }
74  bool follow_sym_links() const { return _follow_syms ; }
75  virtual bool include( const string &inQuestion ) const ;
76  virtual bool exclude( const string &inQuestion ) const ;
77 
78  typedef vector< type_reg >::const_iterator match_citer ;
81 
82  virtual void dump( ostream &strm ) const ;
83 
84  static const BESCatalogUtils *Utils( const string &name ) ;
85 } ;
86 
87 #endif // S_BESCatalogUtils_h
88