libdap Updated for version 3.20.11
libdap4 is an implementation of OPeNDAP's DAP protocol.
|
Regular expression matching. More...
#include <GNURegex.h>
Public Member Functions | |
int | match (const char *s, int len, int pos=0) const |
Does the pattern match. More... | |
int | match (const std::string &s) const |
Does the pattern match. More... | |
Regex (const char *s) | |
initialize a Regex with a C string More... | |
Regex (const char *s, int) | |
Regex (const std::string &s) | |
nitialize a Regex with a C++ string More... | |
int | search (const char *s, int len, int &matchlen, int pos=0) const |
How much of the string does the pattern match. More... | |
int | search (const std::string &s, int &matchlen) const |
How much of the string does the pattern match. More... | |
Regular expression matching.
This class provides an interface that mimics the libgnu C++ library that was used with the first version of libdap (c. 1993). It can been re-implemented several times, this last time using the C++-11 regex class. We found this was faster than the unix regex_t (man(3)) that was being used.
Definition at line 56 of file GNURegex.h.
|
inlineexplicit |
initialize a Regex with a C string
Definition at line 79 of file GNURegex.h.
|
inline |
Definition at line 81 of file GNURegex.h.
|
inlineexplicit |
nitialize a Regex with a C++ string
Definition at line 83 of file GNURegex.h.
libdap::Regex::~Regex | ( | ) |
Definition at line 110 of file GNURegex.cc.
int libdap::Regex::match | ( | const char * | s, |
int | len, | ||
int | pos = 0 |
||
) | const |
Does the pattern match.
Does the regular expression match the string?
s | The string |
len | The length of string to consider |
pos | Start looking at this position in the string |
Definition at line 141 of file GNURegex.cc.
int libdap::Regex::match | ( | const std::string & | s | ) | const |
Does the pattern match.
Search for a match to the regex.
s | The target for the search |
Definition at line 181 of file GNURegex.cc.
int libdap::Regex::search | ( | const char * | s, |
int | len, | ||
int & | matchlen, | ||
int | pos = 0 |
||
) | const |
How much of the string does the pattern match.
Does the regular expression match the string?
s | The string |
len | The length of string to consider |
matchlen | Return the length of the matched portion in this value-result parameter. |
pos | Start looking at this position in the string |
Definition at line 206 of file GNURegex.cc.
int libdap::Regex::search | ( | const std::string & | s, |
int & | matchlen | ||
) | const |
How much of the string does the pattern match.
Search for a match to the regex.
s | The target for the search |
matchlen | The number of characters that matched |
Definition at line 264 of file GNURegex.cc.