Skip to content

Commit 2fe8718

Browse files
committed
Power Linux support added. Updated to v1.4.2
1 parent dd72905 commit 2fe8718

File tree

5 files changed

+32
-23
lines changed

5 files changed

+32
-23
lines changed
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
<?xml version="1.0" encoding="UTF-8"?><launchConfiguration type="com.ibm.etools.systems.launch.RemoteBuildConfigurationType">
2+
<booleanAttribute key="org.eclipse.ui.externaltools.ATTR_BUILDER_ENABLED" value="false"/>
3+
<stringAttribute key="org.eclipse.ui.externaltools.ATTR_DISABLED_BUILDER" value="org.eclipse.jdt.core.javabuilder"/>
4+
<mapAttribute key="org.eclipse.ui.externaltools.ATTR_TOOL_ARGUMENTS"/>
5+
<booleanAttribute key="org.eclipse.ui.externaltools.ATTR_TRIGGERS_CONFIGURED" value="true"/>
6+
</launchConfiguration>

com.ibm.streamsx.regex/.project

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,13 @@
66
</projects>
77
<buildSpec>
88
<buildCommand>
9-
<name>org.eclipse.jdt.core.javabuilder</name>
9+
<name>org.eclipse.ui.externaltools.ExternalToolBuilder</name>
10+
<triggers>full,incremental,</triggers>
1011
<arguments>
12+
<dictionary>
13+
<key>LaunchConfigHandle</key>
14+
<value>&lt;project&gt;/.externalToolBuilders/org.eclipse.jdt.core.javabuilder (9).launch</value>
15+
</dictionary>
1116
</arguments>
1217
</buildCommand>
1318
<buildCommand>

com.ibm.streamsx.regex/impl/include/Regex.h

Lines changed: 18 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,17 @@
11
/*
22
* Regex.h
33
*
4-
* Created on: Nov 27, 2011
4+
* Created on: Nov 27, 2014
55
* Author: leonid.gorelik
66
*/
77

88
#ifndef REGEX_H_
99
#define REGEX_H_
1010

1111
#include <iostream>
12-
#include <string>
1312
#include "sys/time.h"
14-
// Define RE2 regular expression engine
1513
#include "re2/re2.h"
16-
// Define SPL types and functions.
14+
1715
#include "SPL/Runtime/Function/SPLFunctions.h"
1816

1917
using namespace std;
@@ -41,14 +39,14 @@ namespace regex {
4139
}
4240

4341
template<typename Index, typename OP>
44-
inline RE2& getRE2(const string & pattern="", int maxmem=1000000){
45-
static RE2 regex(pattern, getRE2Options<Index,OP>(maxmem));
42+
inline RE2& getRE2(const SPL::rstring & pattern="", int maxmem=1000000){
43+
static RE2 regex(re2::StringPiece(pattern.data(), pattern.size()), getRE2Options<Index,OP>(maxmem));
4644
return regex;
4745
}
4846

4947
template<typename Index>
50-
inline RE2& getRE2Static(const string & pattern="", int maxmem=1000000){
51-
static RE2 regex(pattern, getRE2OptionsStatic<Index>(maxmem));
48+
inline RE2& getRE2Static(const SPL::rstring & pattern="", int maxmem=1000000){
49+
static RE2 regex(re2::StringPiece(pattern.data(), pattern.size()), getRE2OptionsStatic<Index>(maxmem));
5250
return regex;
5351
}
5452

@@ -62,32 +60,32 @@ namespace regex {
6260
getRE2Static<Index>(pattern, maxmem);
6361
}
6462

65-
inline bool regexFullMatch(const string & str, const SPL::rstring & pattern){
66-
return RE2::FullMatch(str, pattern) == 1;
63+
inline bool regexFullMatch(const SPL::rstring & str, const SPL::rstring & pattern){
64+
return RE2::FullMatch(re2::StringPiece(str.data(), str.size()), re2::StringPiece(pattern.data(), pattern.size())) == 1;
6765
}
6866

6967
template<typename Index>
70-
inline bool regexFullMatch(const string & str, const Index & patternIndex){
71-
return RE2::FullMatch(str, getRE2<Index,OperatorInstance>()) == 1;
68+
inline bool regexFullMatch(const SPL::rstring & str, const Index & patternIndex){
69+
return RE2::FullMatch(re2::StringPiece(str.data(), str.size()), getRE2<Index,OperatorInstance>()) == 1;
7270
}
7371

7472
template<typename Index>
75-
inline bool regexFullMatchStatic(const string & str, const Index & patternIndex){
76-
return RE2::FullMatch(str, getRE2Static<Index>()) == 1;
73+
inline bool regexFullMatchStatic(const SPL::rstring & str, const Index & patternIndex){
74+
return RE2::FullMatch(re2::StringPiece(str.data(), str.size()), getRE2Static<Index>()) == 1;
7775
}
7876

79-
inline bool regexPartialMatch(const string & str, const SPL::rstring & pattern){
80-
return RE2::PartialMatch(str, pattern) == 1;
77+
inline bool regexPartialMatch(const SPL::rstring & str, const SPL::rstring & pattern){
78+
return RE2::PartialMatch(re2::StringPiece(str.data(), str.size()), re2::StringPiece(pattern.data(), pattern.size())) == 1;
8179
}
8280

8381
template<typename Index>
84-
inline bool regexPartialMatch(const string & str, const Index & patternIndex){
85-
return RE2::PartialMatch(str, getRE2<Index,OperatorInstance>()) == 1;
82+
inline bool regexPartialMatch(const SPL::rstring & str, const Index & patternIndex){
83+
return RE2::PartialMatch(re2::StringPiece(str.data(), str.size()), getRE2<Index,OperatorInstance>()) == 1;
8684
}
8785

8886
template<typename Index>
89-
inline bool regexPartialMatchStatic(const string & str, const Index & patternIndex){
90-
return RE2::PartialMatch(str, getRE2Static<Index>()) == 1;
87+
inline bool regexPartialMatchStatic(const SPL::rstring & str, const Index & patternIndex){
88+
return RE2::PartialMatch(re2::StringPiece(str.data(), str.size()), getRE2Static<Index>()) == 1;
9189
}
9290
}
9391

com.ibm.streamsx.regex/info.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ Each operator/native function implements partial or full regex match.
1717
**Third-party libraries**
1818
* This toolkit embeds RE2 headers/libraries under impl/&lt;include|lib>.
1919
</info:description>
20-
<info:version>1.4.1</info:version>
20+
<info:version>1.4.2</info:version>
2121
<info:requiredProductVersion>4.0.0</info:requiredProductVersion>
2222
</info:identity>
2323
<info:dependencies/>

com.ibm.streamsx.regex/toolkit.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<?xml version="1.0" encoding="UTF-8" standalone="no" ?>
22
<toolkitModel xmlns="http://www.ibm.com/xmlns/prod/streams/spl/toolkit" productVersion="4.0.1.0" xmlns:common="http://www.ibm.com/xmlns/prod/streams/spl/common" xmlns:ti="http://www.ibm.com/xmlns/prod/streams/spl/toolkitInfo" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
33

4-
<toolkit name="com.ibm.streamsx.regex" requiredProductVersion="4.0.0" version="1.4.1">
4+
<toolkit name="com.ibm.streamsx.regex" requiredProductVersion="4.0.0" version="1.4.2">
55
<description>
66
Support for [http://code.google.com/p/re2|RE2] regular expression library.
77

0 commit comments

Comments
 (0)