irods  4.2.8
About: iRODS (the integrated Rule Oriented Data System) is a distributed data-management system for creating data grids, digital libraries, persistent archives, and real-time data systems.
  Fossies Dox: irods-4.2.8.tar.gz  ("unofficial" and yet experimental doxygen-generated source code documentation)  

irods_re_ruleexistshelper.cpp
Go to the documentation of this file.
2 #include "irods_log.hpp"
3 
5 
7  if (!_instance) {
9  }
10 
11  return _instance;
12 }
13 
14 void RuleExistsHelper::registerRuleRegex( const std::string& _regex ) {
15  boost::regex expr(_regex);
16  ruleRegexes.push_back(expr);
17 }
18 
19 bool RuleExistsHelper::checkOperation( const std::string& _op_name ) {
20  for (auto& expr : ruleRegexes) {
21  if (boost::regex_match(_op_name, expr)) {
22  return true;
23  }
24  }
25 
26  return false;
27 }
28 
29 bool RuleExistsHelper::checkPrePep( const std::string& _ns, const std::string& _op_name ) {
30  const std::string& preString = _ns + "pep_" + _op_name + "_pre";
31 
32  return checkOperation(preString);
33 }
34 
35 bool RuleExistsHelper::checkPostPep( const std::string& _ns, const std::string& _op_name ) {
36  const std::string& postString = _ns + "pep_" + _op_name + "_post";
37 
38  return checkOperation(postString);
39 }
40 
41 bool RuleExistsHelper::checkDynPeps( const std::string& _ns, const std::string& _op_name ) {
42  return checkPrePep(_ns, _op_name) || checkPostPep(_ns, _op_name);
43 }
RuleExistsHelper::Instance
static RuleExistsHelper * Instance()
Definition: irods_re_ruleexistshelper.cpp:6
RuleExistsHelper::ruleRegexes
std::vector< boost::regex > ruleRegexes
Definition: irods_re_ruleexistshelper.hpp:23
irods_re_ruleexistshelper.hpp
RuleExistsHelper::checkOperation
bool checkOperation(const std::string &_op_name)
Definition: irods_re_ruleexistshelper.cpp:19
RuleExistsHelper
Definition: irods_re_ruleexistshelper.hpp:11
RuleExistsHelper::checkDynPeps
bool checkDynPeps(const std::string &_ns, const std::string &_op_name)
Definition: irods_re_ruleexistshelper.cpp:41
RuleExistsHelper::registerRuleRegex
void registerRuleRegex(const std::string &_regex)
Definition: irods_re_ruleexistshelper.cpp:14
RuleExistsHelper::_instance
static RuleExistsHelper * _instance
Definition: irods_re_ruleexistshelper.hpp:21
RuleExistsHelper::checkPostPep
bool checkPostPep(const std::string &_ns, const std::string &_op_name)
Definition: irods_re_ruleexistshelper.cpp:35
RuleExistsHelper::checkPrePep
bool checkPrePep(const std::string &_ns, const std::string &_op_name)
Definition: irods_re_ruleexistshelper.cpp:29
RuleExistsHelper::RuleExistsHelper
RuleExistsHelper()
Definition: irods_re_ruleexistshelper.hpp:21
irods_log.hpp