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

Comparing Bender/Matcher.cpp (file contents):
Revision 304 by Douglas Thrift, 2004-10-27T04:14:56-07:00 vs.
Revision 305 by douglas, 2004-12-12T22:29:04-08:00

# Line 8 | Line 8
8  
9   bool Matcher::match(const ext::String& stuff)
10   {
11 <        substrings.clear();
11 >        substrings.Clear();
12  
13          if (expression != NULL)
14          {
# Line 17 | Line 17 | bool Matcher::match(const ext::String& s
17                  pcre_fullinfo(expression, NULL, PCRE_INFO_CAPTURECOUNT, &length);
18  
19                  int* substrings(new int[(++length *= 3)]);
20 <                int count(pcre_exec(expression, NULL, stuff.NullTerminate(),
21 <                        stuff.GetData().GetSize(), 0, 0, substrings, length));
20 >                int count(pcre_exec(expression, NULL, stuff.GetData().Begin(), stuff.GetData().GetSize(), 0, 0, substrings, length));
21  
22                  if (count > 0)
23                  {
# Line 26 | Line 25 | bool Matcher::match(const ext::String& s
25  
26                          for (int index(0); index < count; ++index)
27                          {
28 <                                pcre_copy_substring(stuff.NullTerminate(), substrings, count,
30 <                                        index, substring, stuff.GetData().GetSize() + 1);
28 >                                pcre_copy_substring(stuff.GetData().Begin(), substrings, count, index, substring, stuff.GetData().GetSize() + 1);
29  
30 <                                this->substrings.push_back(substring);
30 >                                this->substrings.InsertLast(substring);
31                          }
32  
33                          delete [] substring;
# Line 46 | Line 44 | bool Matcher::match(const ext::String& s
44  
45   Matcher& Matcher::operator()(const ext::String& expression)
46   {
47 <        substrings.clear();
47 >        substrings.Clear();
48  
49          if (this->expression != NULL) pcre_free(this->expression);
50  
51          const char* error;
52          int offset;
53  
54 <        this->expression = pcre_compile(expression.NullTerminate(), PCRE_MULTILINE,
57 <                &error, &offset, NULL);
54 >        this->expression = pcre_compile(expression.NullTerminate(), PCRE_MULTILINE, &error, &offset, NULL);
55  
56          return *this;
57   }

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines