summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorph10 <ph10@2f5784b3-3f2a-0410-8824-cb99058d5e15>2008-01-21 14:57:19 +0000
committerph10 <ph10@2f5784b3-3f2a-0410-8824-cb99058d5e15>2008-01-21 14:57:19 +0000
commit4ff532b445e64eb6453bccb24a8e23a6831488ea (patch)
treed90370614d145b71f207f30bf5873c8fb1772d4e
parent1d4f53aa517fc898d563c40cd36243653547177c (diff)
downloadpcre-4ff532b445e64eb6453bccb24a8e23a6831488ea.tar.gz
Apply Craig's patch to move no_arg into the RE class.
git-svn-id: svn://vcs.exim.org/pcre/code/trunk@308 2f5784b3-3f2a-0410-8824-cb99058d5e15
-rw-r--r--ChangeLog7
-rw-r--r--pcre_scanner.h6
-rw-r--r--pcrecpp.cc2
-rw-r--r--pcrecpp.h14
4 files changed, 17 insertions, 12 deletions
diff --git a/ChangeLog b/ChangeLog
index 175f5d1..79d9697 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -26,7 +26,12 @@ Version 7.6 19-Jan-08
4. A user submitted a patch to Makefile that makes it easy to created a dll
under mingw. I added stuff to Makefile.am that cause it to include this
special target, without affecting anything else.
-
+
+5. Applied Craig's patch that moves no_arg into the RE class in the C++ code.
+ This is an attempt to solve the reported problem "pcrecpp::no_arg is not
+ exported in the Windows port". It has not yet been confirmed that the patch
+ solves the problem, but it does no harm.
+
Version 7.5 10-Jan-08
---------------------
diff --git a/pcre_scanner.h b/pcre_scanner.h
index 99a6832..5617e45 100644
--- a/pcre_scanner.h
+++ b/pcre_scanner.h
@@ -80,9 +80,9 @@ class PCRECPP_EXP_DEFN Scanner {
// If it returns true, it skips over the matched input and any
// following input that matches the "skip" regular expression.
bool Consume(const RE& re,
- const Arg& arg0 = no_arg,
- const Arg& arg1 = no_arg,
- const Arg& arg2 = no_arg
+ const Arg& arg0 = RE::no_arg,
+ const Arg& arg1 = RE::no_arg,
+ const Arg& arg2 = RE::no_arg
// TODO: Allow more arguments?
);
diff --git a/pcrecpp.cc b/pcrecpp.cc
index a318d19..0e21718 100644
--- a/pcrecpp.cc
+++ b/pcrecpp.cc
@@ -55,7 +55,7 @@ static const int kMaxArgs = 16;
static const int kVecSize = (1 + kMaxArgs) * 3; // results + PCRE workspace
// Special object that stands-in for no argument
-PCRECPP_EXP_DEFN Arg no_arg((void*)NULL);
+Arg RE::no_arg((void*)NULL);
// If a regular expression has no error, its error_ field points here
static const string empty_string;
diff --git a/pcrecpp.h b/pcrecpp.h
index 646b999..a4638e1 100644
--- a/pcrecpp.h
+++ b/pcrecpp.h
@@ -346,9 +346,6 @@ namespace pcrecpp {
#define PCRE_IS_SET(o) \
(all_options_ & o) == o
-// We convert user-passed pointers into special Arg objects
-PCRECPP_EXP_DECL Arg no_arg;
-
/***** Compiling regular expressions: the RE class *****/
// RE_Options allow you to set options to be passed along to pcre,
@@ -403,25 +400,25 @@ class PCRECPP_EXP_DEFN RE_Options {
return PCRE_IS_SET(PCRE_DOTALL);
}
RE_Options &set_dotall(bool x) {
- PCRE_SET_OR_CLEAR(x,PCRE_DOTALL);
+ PCRE_SET_OR_CLEAR(x, PCRE_DOTALL);
}
bool extended() const {
return PCRE_IS_SET(PCRE_EXTENDED);
}
RE_Options &set_extended(bool x) {
- PCRE_SET_OR_CLEAR(x,PCRE_EXTENDED);
+ PCRE_SET_OR_CLEAR(x, PCRE_EXTENDED);
}
bool dollar_endonly() const {
return PCRE_IS_SET(PCRE_DOLLAR_ENDONLY);
}
RE_Options &set_dollar_endonly(bool x) {
- PCRE_SET_OR_CLEAR(x,PCRE_DOLLAR_ENDONLY);
+ PCRE_SET_OR_CLEAR(x, PCRE_DOLLAR_ENDONLY);
}
bool extra() const {
- return PCRE_IS_SET( PCRE_EXTRA);
+ return PCRE_IS_SET(PCRE_EXTRA);
}
RE_Options &set_extra(bool x) {
PCRE_SET_OR_CLEAR(x, PCRE_EXTRA);
@@ -646,6 +643,9 @@ class PCRECPP_EXP_DEFN RE {
// regexp wasn't valid on construction.
int NumberOfCapturingGroups() const;
+ // The default value for an argument, to indicate no arg was passed in
+ static Arg no_arg;
+
private:
void Init(const string& pattern, const RE_Options* options);