RegularExpression.h
1//-*-C++-*-
2/***************************************************************************
3 *
4 * Copyright (C) 2006 by Willem van Straten
5 * Licensed under the Academic Free License version 2.1
6 *
7 ***************************************************************************/
8
9// psrchive/Util/genutil/RegularExpression.h
10
11#ifndef __RegularExpression_h
12#define __RegularExpression_h
13
14#include "Error.h"
15
18
19 public:
20
23
25 RegularExpression (const std::string& regexp);
26
29
31 void set_regexp (const std::string& regexp);
32
34 bool get_match (const std::string& test);
35
36 protected:
37
39 Error error (int err, const std::string& func, const std::string& message);
40
41 private:
42
44 void* preg;
45
46 void destroy ();
47};
48
49#endif
50
A convenient exception handling class.
Definition Error.h:54
bool get_match(const std::string &test)
Check if the supplied string matches the regular expression.
Definition RegularExpression.C:60
void set_regexp(const std::string &regexp)
Set the regular expression.
Definition RegularExpression.C:43
~RegularExpression()
Destructor.
Definition RegularExpression.C:29
RegularExpression()
Default constructor.
Definition RegularExpression.C:16
Error error(int err, const std::string &func, const std::string &message)
Return an instance of the Error class with regerror message.
Definition RegularExpression.C:77

Generated using doxygen 1.14.0