summaryrefslogtreecommitdiff
path: root/src/regex.cpp
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--src/regex.cpp12
1 files changed, 6 insertions, 6 deletions
diff --git a/src/regex.cpp b/src/regex.cpp
index e634639..8c28333 100644
--- a/src/regex.cpp
+++ b/src/regex.cpp
@@ -19,7 +19,7 @@ Bu::RegEx::RegEx() :
19{ 19{
20} 20}
21 21
22Bu::RegEx::RegEx( const Bu::FString &sSrc ) : 22Bu::RegEx::RegEx( const Bu::String &sSrc ) :
23 pRegEx( NULL ), 23 pRegEx( NULL ),
24 bCompiled( false ), 24 bCompiled( false ),
25 paSubStr( NULL ) 25 paSubStr( NULL )
@@ -37,7 +37,7 @@ Bu::RegEx::~RegEx()
37 } 37 }
38} 38}
39 39
40void Bu::RegEx::compile( const Bu::FString &sSrc ) 40void Bu::RegEx::compile( const Bu::String &sSrc )
41{ 41{
42 if( bCompiled ) 42 if( bCompiled )
43 { 43 {
@@ -54,7 +54,7 @@ void Bu::RegEx::compile( const Bu::FString &sSrc )
54 size_t length = regerror( nErr, re, NULL, 0 ); 54 size_t length = regerror( nErr, re, NULL, 0 );
55 char *buffer = new char[length]; 55 char *buffer = new char[length];
56 (void) regerror( nErr, re, buffer, length ); 56 (void) regerror( nErr, re, buffer, length );
57 Bu::FString s( buffer ); 57 Bu::String s( buffer );
58 delete[] buffer; 58 delete[] buffer;
59 throw "???"; // BuildException( s.getStr() ); 59 throw "???"; // BuildException( s.getStr() );
60 } 60 }
@@ -70,7 +70,7 @@ int Bu::RegEx::getNumSubStrings()
70 return nSubStr; 70 return nSubStr;
71} 71}
72 72
73bool Bu::RegEx::execute( const Bu::FString &sSrc ) 73bool Bu::RegEx::execute( const Bu::String &sSrc )
74{ 74{
75 sTest = sSrc; 75 sTest = sSrc;
76 if( regexec( re, sSrc.getStr(), nSubStr, aSubStr, 0 ) ) 76 if( regexec( re, sSrc.getStr(), nSubStr, aSubStr, 0 ) )
@@ -84,10 +84,10 @@ void Bu::RegEx::getSubStringRange( int nIndex, int &iStart, int &iEnd )
84 iEnd = aSubStr[nIndex].rm_eo; 84 iEnd = aSubStr[nIndex].rm_eo;
85} 85}
86 86
87Bu::FString Bu::RegEx::getSubString( int nIndex ) 87Bu::String Bu::RegEx::getSubString( int nIndex )
88{ 88{
89// regmatch_t *Subs = aSubStr; 89// regmatch_t *Subs = aSubStr;
90 return Bu::FString( 90 return Bu::String(
91 sTest.getStr()+aSubStr[nIndex].rm_so, 91 sTest.getStr()+aSubStr[nIndex].rm_so,
92 aSubStr[nIndex].rm_eo - aSubStr[nIndex].rm_so 92 aSubStr[nIndex].rm_eo - aSubStr[nIndex].rm_so
93 ); 93 );