OPAL (Object Oriented Parallel Accelerator Library)
2024.2
OPAL
src
Utilities
RegularExpression.h
Go to the documentation of this file.
1
#ifndef OPAL_RegularExpression_HH
2
#define OPAL_RegularExpression_HH 1
3
4
// ------------------------------------------------------------------------
5
// $RCSfile: RegularExpression.h,v $
6
// ------------------------------------------------------------------------
7
// $Revision: 1.1.1.1 $
8
// ------------------------------------------------------------------------
9
// Copyright: see Copyright.readme
10
// ------------------------------------------------------------------------
11
//
12
// Class: RegularExpression.
13
//
14
// ------------------------------------------------------------------------
15
//
16
// $Date: 2000/03/27 09:33:48 $
17
// $Author: Andreas Adelmann $
18
//
19
// ------------------------------------------------------------------------
20
21
#include <string>
22
23
24
// Class RegularExpression
25
// ------------------------------------------------------------------------
27
// This class encapsulates the UNIX regular expressions as defined in
28
// regexp(5). It provides a simple interface to the POSIX-compliant
29
// regcomp/regexec package.
30
31
class
RegularExpression
{
32
33
public
:
34
36
// Construct regular expression from [b]pattern[/b].
37
// If [b]ignore[/b] is true, the expression ignores upper/lower case.
38
RegularExpression
(
const
std::string &pattern,
bool
ignore =
false
);
39
40
RegularExpression
(
const
RegularExpression
&);
41
~RegularExpression
();
42
44
bool
match
(
const
std::string &s)
const
;
45
47
bool
OK
()
const
;
48
49
private
:
50
51
// Not implemented.
52
void
operator =
(
const
RegularExpression
&);
53
54
// Initialise.
55
void
init
();
56
57
// A copy of the pattern string.
58
const
std::string
patt
;
59
60
// The flag to ignore case.
61
bool
caseIgnore
;
62
63
// The compiled regular expression.
64
class
Expression
;
65
Expression
*
expr
;
66
67
// The state flag, indicating any error condition.
68
int
state
;
69
};
70
71
#endif
// OPAL_RegularExpressions_HH
RegularExpression::Expression
Definition
RegularExpression.cpp:35
RegularExpression
A regular expression.
Definition
RegularExpression.h:31
RegularExpression::match
bool match(const std::string &s) const
Match a string against the pattern.
Definition
RegularExpression.cpp:58
RegularExpression::state
int state
Definition
RegularExpression.h:68
RegularExpression::patt
const std::string patt
Definition
RegularExpression.h:58
RegularExpression::OK
bool OK() const
Check the regular expression for sanity.
Definition
RegularExpression.cpp:79
RegularExpression::caseIgnore
bool caseIgnore
Definition
RegularExpression.h:61
RegularExpression::init
void init()
Definition
RegularExpression.cpp:84
RegularExpression::expr
Expression * expr
Definition
RegularExpression.h:65
RegularExpression::~RegularExpression
~RegularExpression()
Definition
RegularExpression.cpp:53
RegularExpression::operator=
void operator=(const RegularExpression &)
Generated on Tue Apr 14 2026 07:18:46 for OPAL (Object Oriented Parallel Accelerator Library) by
1.9.8