Loading [MathJax]/extensions/tex2jax.js
The Gaudi Framework
master (f31105fd)
Main Page
Related Pages
Modules
Namespaces
Namespace List
Namespace Members
All
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
Functions
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
Variables
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
Typedefs
a
b
c
d
e
f
h
i
l
m
o
p
r
s
t
u
v
w
x
Enumerations
Enumerator
a
b
c
d
e
f
g
h
i
k
l
m
n
o
p
q
r
s
t
u
v
w
y
Classes
Class List
Class Index
Class Hierarchy
Class Members
All
:
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
~
Functions
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
~
Variables
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
Typedefs
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
Enumerations
a
c
d
e
f
i
l
m
n
o
p
q
r
s
t
v
Enumerator
a
b
c
d
e
f
i
j
k
l
m
n
o
p
r
s
t
u
v
w
Properties
Related Functions
:
a
b
c
d
e
g
h
i
m
o
p
r
s
t
v
Files
File List
File Members
All
_
a
b
c
d
e
f
g
h
i
k
l
m
n
o
p
q
r
s
t
u
v
w
x
z
Functions
_
b
c
e
f
g
h
i
l
m
n
o
p
r
s
t
u
z
Variables
a
b
c
d
e
g
h
i
m
o
p
q
r
s
t
v
x
Typedefs
_
a
b
c
d
e
f
g
h
i
l
m
n
o
p
r
s
t
u
w
Enumerations
Enumerator
c
e
f
p
u
v
Macros
_
a
b
c
d
e
f
g
h
i
k
l
m
n
o
p
r
s
t
u
v
w
•
All
Classes
Namespaces
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Properties
Friends
Macros
Modules
Pages
RegEx.h
Go to the documentation of this file.
1
/***********************************************************************************\
2
* (c) Copyright 1998-2019 CERN for the benefit of the LHCb and ATLAS collaborations *
3
* *
4
* This software is distributed under the terms of the Apache version 2 licence, *
5
* copied verbatim in the file "LICENSE". *
6
* *
7
* In applying this licence, CERN does not waive the privileges and immunities *
8
* granted to it by virtue of its status as an Intergovernmental Organization *
9
* or submit itself to any jurisdiction. *
10
\***********************************************************************************/
11
#ifndef GAUDIUTILS_REGEX_H
12
#define GAUDIUTILS_REGEX_H
13
// ============================================================================
14
// Include files
15
// ============================================================================
16
#include <boost/regex.hpp>
17
#include <string>
18
19
/*
20
* Gaudi namespace declaration
21
*/
22
namespace
Gaudi
{
23
namespace
Utils {
24
// ========================================================================
33
namespace
RegEx {
34
class
matchList
{
35
std::vector<boost::regex>
m_regs
;
36
37
public
:
38
template
<
typename
C>
39
matchList
(
const
C&
c
) {
40
m_regs
.
reserve
(
c
.size() );
41
std::transform
(
std::begin
(
c
),
std::end
(
c
),
std::back_inserter
(
m_regs
),
42
[](
typename
C::const_reference i ) {
return
boost::regex{ i }; } );
43
}
44
45
bool
Or
(
const
std::string
&
test
)
const
{
46
return
std::any_of
(
std::begin
(
m_regs
),
std::end
(
m_regs
),
47
[&](
const
boost::regex& r ) {
return
boost::regex_match(
test
, r ); } );
48
}
49
bool
And
(
const
std::string
&
test
)
const
{
50
return
std::all_of
(
std::begin
(
m_regs
),
std::end
(
m_regs
),
51
[&](
const
boost::regex& r ) {
return
boost::regex_match(
test
, r ); } );
52
}
53
};
54
63
template
<
typename
T>
64
bool
matchOr
(
const
std::string
&
test
,
const
T&
regexps
) {
65
// compares the string in test, to the regexps in a container
66
//
67
return
std::any_of
(
std::begin
(
regexps
),
std::end
(
regexps
), [&](
typename
T::const_reference i ) {
68
return
boost::regex_match(
test
, boost::regex{ i } );
69
} );
70
}
71
80
template
<
typename
T>
81
bool
matchAnd
(
const
std::string
&
test
,
const
T&
regexps
) {
82
// compares the string in test, to the regexps in a container
83
//
84
return
std::all_of
(
std::begin
(
regexps
),
std::end
(
regexps
), [&](
typename
T::const_reference i ) {
85
return
boost::regex_match(
test
, boost::regex{ i } );
86
} );
87
}
88
}
// namespace RegEx
89
}
// namespace Utils
90
}
// namespace Gaudi
91
#endif
Gaudi::Utils::RegEx::matchList
Definition:
RegEx.h:34
std::string
STL class.
std::vector::reserve
T reserve(T... args)
std::vector< boost::regex >
std::back_inserter
T back_inserter(T... args)
Gaudi::Utils::RegEx::matchList::And
bool And(const std::string &test) const
Definition:
RegEx.h:49
gaudirun.c
c
Definition:
gaudirun.py:525
std::any_of
T any_of(T... args)
Gaudi::Utils::RegEx::matchList::m_regs
std::vector< boost::regex > m_regs
Definition:
RegEx.h:35
Gaudi::Utils::RegEx::matchAnd
bool matchAnd(const std::string &test, const T ®exps)
return true if the string is in all of the regex's
Definition:
RegEx.h:81
Gaudi::Utils::RegEx::matchList::matchList
matchList(const C &c)
Definition:
RegEx.h:39
GaudiTesting.BaseTest.regexps
list regexps
Definition:
BaseTest.py:1161
std::transform
T transform(T... args)
Gaudi
This file provides a Grammar for the type Gaudi::Accumulators::Axis It allows to use that type from p...
Definition:
__init__.py:1
Gaudi::Utils::RegEx::matchOr
bool matchOr(const std::string &test, const T ®exps)
return true if the string is in any of the regex's
Definition:
RegEx.h:64
std::begin
T begin(T... args)
compareRootHistos.test
test
Definition:
compareRootHistos.py:28
std::end
T end(T... args)
Gaudi::Utils::RegEx::matchList::Or
bool Or(const std::string &test) const
Definition:
RegEx.h:45
GaudiUtils
include
GaudiUtils
RegEx.h
Generated on Mon Apr 7 2025 16:26:26 for The Gaudi Framework by
1.8.18