Skip to content

Commit

Permalink
Inlined all the header functions.
Browse files Browse the repository at this point in the history
leongor committed Jan 4, 2015
1 parent be297ce commit a2f15a6
Showing 2 changed files with 6 additions and 6 deletions.
Original file line number Diff line number Diff line change
@@ -95,7 +95,7 @@ RegexMatch operator has three custom output functions:
</inputPorts>
<outputPorts>
<outputPortSet>
<description>The RegexMatch operator is configurable with one output port. The output port is mutating and their punctuation mode is Preserving.</description>
<description>The RegexMatch operator is configurable with one output port. The output port is mutating and its punctuation mode is Preserving.</description>
<expressionMode>Expression</expressionMode>
<autoAssignment>true</autoAssignment>
<completeAssignment>true</completeAssignment>
10 changes: 5 additions & 5 deletions com.ibm.streamsx.regex/impl/include/Regex.h
Original file line number Diff line number Diff line change
@@ -20,27 +20,27 @@ using namespace std;

namespace regex {

RE2::Options& getRE2Options(int maxmem){
inline RE2::Options& getRE2Options(int maxmem){
static RE2::Options options;
options.set_log_errors(false);
options.set_max_mem(maxmem);
return options;
}

RE2& getRE2(const string & pattern, int maxmem){
inline RE2& getRE2(const string & pattern, int maxmem){
static RE2 regex(pattern, getRE2Options(maxmem));
return regex;
}

bool regexFullMatch(const string & str, const string & pattern="", int maxmem=1000000){
inline bool regexFullMatch(const string & str, const string & pattern="", int maxmem=1000000){
return RE2::FullMatch(str, getRE2(pattern, maxmem)) == 1;
}

bool regexPartialMatch(const string & str, const string & pattern="", int maxmem=1000000){
inline bool regexPartialMatch(const string & str, const string & pattern="", int maxmem=1000000){
return RE2::PartialMatch(str, getRE2(pattern, maxmem)) == 1;
}

bool regexSimpleMatch(const string & str, const string & pattern){
inline bool regexSimpleMatch(const string & str, const string & pattern){
return RE2::PartialMatch(str, pattern) == 1;
}
}

0 comments on commit a2f15a6

Please sign in to comment.