ViewVC Help
View File | Revision Log | Show Annotations | Download File | View Changeset | Root Listing
root/zoe/trunk/Matcher.cpp
(Generate patch)

Comparing trunk/Matcher.cpp (file contents):
Revision 7 by douglas, 2004-07-09T17:12:54-07:00 vs.
Revision 10 by douglas, 2004-07-10T17:01:15-07:00

# Line 6 | Line 6
6  
7   #include "Matcher.hpp"
8  
9 < Matcher::Matcher(const ext::String& expression)
9 > Matcher::Matcher(const ext::String& expression) : expression(NULL)
10   {
11        this->expression = NULL;
12
11          (*this)(expression);
12   }
13  
# Line 31 | Line 29 | bool Matcher::match(const ext::String& s
29  
30                  pcre_fullinfo(expression, NULL, PCRE_INFO_CAPTURECOUNT, &length);
31  
32 <                int* substrings = new int[(++length *= 3)];
33 <                int count = pcre_exec(expression, NULL, stuff.c_str(), stuff.length(),
34 <                        0, 0, substrings, length);
32 >                int* substrings(new int[(++length *= 3)]);
33 >                int count(pcre_exec(expression, NULL, stuff.c_str(), stuff.length(), 0, 0,
34 >                        substrings, length));
35  
36                  if (count > 0)
37                  {
38 <                        char* substring = new char[stuff.length() + 1];
38 >                        char* substring(new char[stuff.length() + 1]);
39  
40 <                        for (int index = 0; index < count; index++)
40 >                        for (int index(0); index < count; ++index)
41                          {
42                                  pcre_copy_substring(stuff.c_str(), substrings, count, index,
43                                          substring, stuff.length() + 1);

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines