|
| BESCatalogUtils (const std::string &name, bool strict=true) |
| Initialize the file system catalog utilities.
|
|
virtual void | dump (std::ostream &strm) const |
| dump the contents of this object to the specified ostream
|
|
virtual bool | exclude (const std::string &inQuestion) const |
| Should this file/directory be excluded in the catalog?
|
|
bool | follow_sym_links () const |
|
virtual unsigned int | get_entries (DIR *dip, const std::string &fullnode, const std::string &use_node, BESCatalogEntry *entry, bool dirs_only) |
|
std::string | get_handler_name (const std::string &item) const |
| Find the handler name that will process.
|
|
const std::string & | get_root_dir () const |
| Get the root directory of the catalog.
|
|
virtual bool | include (const std::string &inQuestion) const |
| Should this file/directory be included in the catalog?
|
|
bool | is_data (const std::string &item) const |
| is there a handler that can process this
|
|
Definition at line 61 of file BESCatalogUtils.h.
◆ BESCatalogUtils()
BESCatalogUtils::BESCatalogUtils |
( |
const std::string & |
name, |
|
|
bool |
strict = true |
|
) |
| |
Initialize the file system catalog utilities.
Use parameters in the bes.conf file to configure a BES catalog that reads data from a file system. This will set the root directory of the catalog, regular expressions to exclude and include entries, regular expressions to identify data, and whether the catalog should follow symbolic links. The bes.conf key names are (N == catalog name):
BES.Catalog.N.RootDirectory BES.Catalog.N.Exclude BES.Catalog.N.Include BES.Catalog.N.TypeMatch BES.Catalog.N.FollowSymLinks
- Note
- The RootDirectory and TypeMatch keys must be present for any catalog N.
- Parameters
-
n | The name of the catalog. |
strict | True (the default) means that the RootDirectory and TypeMatch must be defined; false causes this constructor to supply placeholder values. This feature was added for tests that run without the bes.conf file. |
Definition at line 83 of file BESCatalogUtils.cc.
◆ ~BESCatalogUtils()
virtual BESCatalogUtils::~BESCatalogUtils |
( |
| ) |
|
|
inlinevirtual |
◆ bes_add_stat_info()
void BESCatalogUtils::bes_add_stat_info |
( |
BESCatalogEntry * |
entry, |
|
|
const std::string & |
fullnode |
|
) |
| |
|
static |
Add info about a node to an BESCatalogEntry object. This method calls stat(2) and passes the result to bes_add_stat_into().
- Parameters
-
Definition at line 461 of file BESCatalogUtils.cc.
◆ display_entry()
◆ dump()
void BESCatalogUtils::dump |
( |
std::ostream & |
strm | ) |
const |
|
virtual |
dump the contents of this object to the specified ostream
This method is implemented by all derived classes to dump their contents, in other words, any state they might have, private variables, etc...
The inline function below can be used to dump the contents of an OPeNDAPObj object. For example, the object Animal is derived from BESObj. A user could do the following:
Animal *a = new dog( "Sparky" ) ; cout << a << endl ;
And the dump method for dog could display the name passed into the constructor, the (this) pointer of the object, etc...
- Parameters
-
strm | C++ i/o stream to dump the object to |
Implements BESObj.
Definition at line 502 of file BESCatalogUtils.cc.
◆ exclude()
bool BESCatalogUtils::exclude |
( |
const std::string & |
inQuestion | ) |
const |
|
virtual |
Should this file/directory be excluded in the catalog?
- See also
- BESCatalogUtils::include
- Parameters
-
inQuestion | The file or directory name in question |
- Returns
- True if the file/directory should be excluded, false if not.
Definition at line 229 of file BESCatalogUtils.cc.
◆ follow_sym_links()
bool BESCatalogUtils::follow_sym_links |
( |
| ) |
const |
|
inline |
◆ get_entries()
unsigned int BESCatalogUtils::get_entries |
( |
DIR * |
dip, |
|
|
const std::string & |
fullnode, |
|
|
const std::string & |
use_node, |
|
|
BESCatalogEntry * |
entry, |
|
|
bool |
dirs_only |
|
) |
| |
|
virtual |
◆ get_handler_name()
std::string BESCatalogUtils::get_handler_name |
( |
const std::string & |
item | ) |
const |
Find the handler name that will process.
Using the TypeMatch regular expressions for the Catalog that holds this instance of CatalogUtils, find a handler that can process
- Note
- Use
BESServiceRegistry::TheRegistry()->services_handled(...);
to get a list of the services provided by the handler.
- Parameters
-
item | The item to be handled |
- Returns
- The handler name. The empty string if the item cannot be processed by any handler.
Definition at line 417 of file BESCatalogUtils.cc.
◆ get_root_dir()
const std::string & BESCatalogUtils::get_root_dir |
( |
| ) |
const |
|
inline |
Get the root directory of the catalog.
- Returns
- The pathname that is the root of the 'catalog'
Definition at line 102 of file BESCatalogUtils.h.
◆ include()
bool BESCatalogUtils::include |
( |
const std::string & |
inQuestion | ) |
const |
|
virtual |
Should this file/directory be included in the catalog?
First check if the file should be included (matches at least one regex on the include list). If there are no regexes on the include list, that means include everything. Then test the exclude list. If there are no regexes on the exclude list, exclude nothing.
- Parameters
-
inQuestion | File or directory in question |
- Returns
- True if it should be included, false if not.
Definition at line 178 of file BESCatalogUtils.cc.
◆ is_data()
bool BESCatalogUtils::is_data |
( |
const std::string & |
item | ) |
const |
is there a handler that can process this
Using the TypeMatch regular expressions for the Catalog that holds this instance of CatalogUtils, find a handler that can process
- Parameters
-
item | The item to be handled |
- Returns
- The handler name. The empty string if the item cannot be processed by any handler.
- See also
- get_handler_name()
Definition at line 442 of file BESCatalogUtils.cc.
◆ isData()
bool BESCatalogUtils::isData |
( |
const std::string & |
inQuestion, |
|
|
const std::string & |
catalog, |
|
|
std::list< std::string > & |
services |
|
) |
| |
|
static |
The documentation for this class was generated from the following files: