From 6c92add4b94e1b5ab35f197fc51e427b1c5d9d77 Mon Sep 17 00:00:00 2001 From: Oskari Timperi Date: Tue, 7 Jan 2014 15:40:29 +0200 Subject: c++ changes --- TRexpp.h | 6 ++---- trex.h | 8 ++++++++ 2 files changed, 10 insertions(+), 4 deletions(-) diff --git a/TRexpp.h b/TRexpp.h index 430925b..a4b7c02 100644 --- a/TRexpp.h +++ b/TRexpp.h @@ -27,9 +27,7 @@ ****************************************************************/ -extern "C" { #include "trex.h" -} struct TRexParseException{TRexParseException(const TRexChar *c):desc(c){}const TRexChar *desc;}; @@ -38,10 +36,10 @@ public: TRexpp() { _exp = (TRex *)0; } ~TRexpp() { CleanUp(); } // compiles a regular expression - void Compile(const TRexChar *pattern) { + void Compile(const TRexChar *pattern, int flags) { const TRexChar *error; CleanUp(); - if(!(_exp = trex_compile(pattern,&error))) + if(!(_exp = trex_compile(pattern,&error,flags))) throw TRexParseException(error); } // return true if the given text match the expression diff --git a/trex.h b/trex.h index 9348bcb..4e85f6e 100644 --- a/trex.h +++ b/trex.h @@ -27,6 +27,10 @@ ****************************************************************/ +#ifdef __cplusplus +extern "C" { +#endif + #ifdef _UNICODE #define TRexChar unsigned short #define MAX_CHAR 0xFFFF @@ -66,4 +70,8 @@ TREX_API TRexBool trex_searchrange(TRex* exp,const TRexChar* text_begin,const TR TREX_API int trex_getsubexpcount(TRex* exp); TREX_API TRexBool trex_getsubexp(TRex* exp, int n, TRexMatch *subexp); +#ifdef __cplusplus +} +#endif + #endif -- cgit v1.2.3