summaryrefslogtreecommitdiff
path: root/utils/RegExp.cc
diff options
context:
space:
mode:
authorsc2000-11-28 14:19:35 +0000
committersc2000-11-28 14:19:35 +0000
commit325530e630c68c7c10a2f4339f5b43434fcd0329 (patch)
tree8e655f6002598176ed0e9e5e0ba3bcb0971c434d /utils/RegExp.cc
parentb8af7905fd61ce5cb2c94da78ccc9e051f9ceddc (diff)
downloadivy-league-325530e630c68c7c10a2f4339f5b43434fcd0329.zip
ivy-league-325530e630c68c7c10a2f4339f5b43434fcd0329.tar.gz
ivy-league-325530e630c68c7c10a2f4339f5b43434fcd0329.tar.bz2
ivy-league-325530e630c68c7c10a2f4339f5b43434fcd0329.tar.xz
Incorporation into IvyLeague
Ccu -> Ivl ccu -> ivl Smart pointers disappear (too dangerous) Imakefile disappears (Makefile now) An empty cplus_bugs.h has been created locally
Diffstat (limited to 'utils/RegExp.cc')
-rw-r--r--utils/RegExp.cc31
1 files changed, 14 insertions, 17 deletions
diff --git a/utils/RegExp.cc b/utils/RegExp.cc
index 82e5dab..994b8d7 100644
--- a/utils/RegExp.cc
+++ b/utils/RegExp.cc
@@ -15,24 +15,23 @@
#include "RegExp.h"
-/*?class CcuRegExp
-The class \typ{CcuRegExp} was designed to encapsulate regular expression management,
+/*?class IvlRegExp
+The class \typ{IvlRegExp} was designed to encapsulate regular expression management,
implemented by \fun{re\_comp} and \fun{re\_exec}, or \fun{regcmp} and \fun{regex},
depending on the operating system. The standard usage consists in initializing
-a \typ{CcuRegExp}, then compiling it, and finally match strings against it.
+a \typ{IvlRegExp}, then compiling it, and finally match strings against it.
?*/
#ifdef DOC
/*?
-Initialize a \typ{CcuRegExp} with expression \var{expr}. The string \var{epxr}
+Initialize a \typ{IvlRegExp} with expression \var{expr}. The string \var{epxr}
is {\em not} copied.
?*/
-CcuRegExp :: CcuRegExp (const char* expr)
+IvlRegExp :: IvlRegExp (const char* expr)
{
}
#endif
-
#ifdef REGCOMP
#include <regex.h>
#include <memory.h>
@@ -43,7 +42,7 @@ Compile a regular expression before using it. This function returns false upon f
true upon success.
?*/
bool
-CcuRegExp :: Compile ()
+IvlRegExp :: Compile ()
{
struct regex_t tmp;
if (regcomp (&tmp, String, REG_NOSUB) == 0) {
@@ -59,7 +58,7 @@ Match a string against a regular expression. This function returns false upon fa
true upon success.
?*/
bool
-CcuRegExp :: Match (const char* s)
+IvlRegExp :: Match (const char* s)
{
if (Compiled)
return regexec ((struct regex_t*) Compiled, s, 0, 0, 0) == 0 ? true : false;
@@ -68,7 +67,7 @@ CcuRegExp :: Match (const char* s)
}
/*?nodoc?*/
-CcuRegExp :: ~CcuRegExp ()
+IvlRegExp :: ~IvlRegExp ()
{
if (Compiled) {
regfree ((struct regex_t*) Compiled);
@@ -78,7 +77,6 @@ CcuRegExp :: ~CcuRegExp ()
#endif
-
#ifdef RE_COMP
extern "C" {
@@ -87,12 +85,11 @@ extern "C" {
}
/* should be #include <regcmp.h>, but not available everywhere ... */
-
-CcuRegExp* CcuRegExp::Compiled = 0;
+IvlRegExp* IvlRegExp::Compiled = 0;
/*?nodoc?*/
bool
-CcuRegExp :: Compile ()
+IvlRegExp :: Compile ()
{
if (re_comp (String) != 0) {
Compiled = 0;
@@ -105,7 +102,7 @@ CcuRegExp :: Compile ()
/*?nodoc?*/
bool
-CcuRegExp :: Match (const char* s)
+IvlRegExp :: Match (const char* s)
{
if (Compiled != this)
if (!Compile ())
@@ -134,7 +131,7 @@ Compile a regular expression before using it. This function returns false upon f
true upon success.
?*/
bool
-CcuRegExp :: Compile ()
+IvlRegExp :: Compile ()
{
Compiled = regcmp (String, 0);
return Compiled ? true : false;
@@ -145,7 +142,7 @@ Match a string against a regular expression. This function returns false upon fa
true upon success.
?*/
bool
-CcuRegExp :: Match (const char* s)
+IvlRegExp :: Match (const char* s)
{
if (Compiled)
return regex (Compiled, s) ? true : false;
@@ -154,7 +151,7 @@ CcuRegExp :: Match (const char* s)
}
/*?nodoc?*/
-CcuRegExp :: ~CcuRegExp ()
+IvlRegExp :: ~IvlRegExp ()
{
if (Compiled)
free (Compiled);