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

Comparing trunk/Matcher.hpp (file contents):
Revision 6 by douglas, 2004-07-09T15:09:38-07:00 vs.
Revision 7 by douglas, 2004-07-09T17:12:54-07:00

# Line 15 | Line 15 | class Matcher
15   {
16   private:
17          pcre* expression;
18 <        std::vector<std::string> substrings;
18 >        std::vector<ext::String> substrings;
19   public:
20          Matcher() : expression(NULL) {}
21 <        Matcher(const std::string& expression);
21 >        Matcher(const ext::String& expression);
22          ~Matcher();
23 <        bool match(const std::string& stuff);
23 >        bool match(const ext::String& stuff);
24          unsigned size(void) const { return substrings.size(); }
25 <        Matcher& operator()(const std::string& expression);
26 <        const std::string& operator[](unsigned index) const { return
25 >        Matcher& operator()(const ext::String& expression);
26 >        const ext::String& operator[](unsigned index) const { return
27                  substrings[index]; }
28 <        operator std::string() const { return substrings[0]; }
29 <        bool operator==(const std::string& stuff) { return match(stuff); }
30 <        bool operator!=(const std::string& stuff) { return !match(stuff); }
28 >        operator ext::String() const { return substrings[0]; }
29 >        bool operator==(const ext::String& stuff) { return match(stuff); }
30 >        bool operator!=(const ext::String& stuff) { return !match(stuff); }
31   // friends:
32 <        friend bool operator==(const std::string& stuff, Matcher& matcher) { return
32 >        friend bool operator==(const ext::String& stuff, Matcher& matcher) { return
33                  matcher == stuff; }
34 <        friend bool operator!=(const std::string& stuff, Matcher& matcher) { return
34 >        friend bool operator!=(const ext::String& stuff, Matcher& matcher) { return
35                  matcher != stuff; }
36   };
37  

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines