ViewVC Help
View File | Revision Log | Show Annotations | Download File | View Changeset | Root Listing
root/repos/SiteMapper/Page.hpp
(Generate patch)

Comparing SiteMapper/Page.hpp (file contents):
Revision 141 by Douglas Thrift, 2004-03-25T19:21:58-08:00 vs.
Revision 285 by douglas, 2004-11-28T03:01:11-08:00

# Line 14 | Line 14 | class Matcher;
14   class Page
15   {
16   private:
17 <        string address;
18 <        string path;
19 <        string title;
20 <        vector<Page> children;
21 <        unsigned tab;
17 >        ext::String address, path, title;
18 >        ext::Vector<Page> children;
19 >        ext::String childOf;
20   public:
21 <        Page(const string& address, const string& path, const string& title);
22 <        Page(const string& url, const string& title);
21 >        Page() {}
22 >        Page(const ext::String& address, const ext::String& path, const ext::String& title) : address(address), path(path), title(title) {}
23 >        Page(const ext::String& url, const ext::String& title) : title(title) { setUrl(url); }
24          ~Page() {}
25 <        string& getAddress(void) { return address; }
26 <        string& getPath(void) { return path; }
27 <        string& getTitle(void) { return title; }
28 <        vector<Page>& getChildren(void) { return children; }
29 <        string getUrl(void) { return "http://" + address + path; }
30 <        void setAddress(const string& address) { this->address = address; }
31 <        void setPath(const string& path) { this->path = path; }
32 <        void setTitle(const string& title) { this->title = title; }
33 <        void setChildren(vector<Page>& children) { this->children = children; }
34 <        void setUrl(const string& url);
35 <        Page& operator()(unsigned tab) { this->tab = tab; return *this; }
36 <        bool operator==(const string& thing);
25 >        ext::String& getAddress() { return address; }
26 >        ext::String& getPath() { return path; }
27 >        ext::String& getTitle() { return title; }
28 >        ext::Vector<Page>& getChildren() { return children; }
29 >        ext::String& getChildOf() { return childOf; }
30 >        ext::String getUrl() const { return ios::String() << "http://" << address << path; }
31 >        void setAddress(const ext::String& address) { this->address = address; }
32 >        void setPath(const ext::String& path) { this->path = path; }
33 >        void setTitle(const ext::String& title) { this->title = title; }
34 >        void setChildren(ext::Vector<Page>& children) { this->children = children; }
35 >        void setChildOf(const ext::String& childOf) { this->childOf = childOf; }
36 >        void setUrl(const ext::String& url);
37 >        bool operator==(const ext::String& thing);
38          bool operator==(Matcher& matcher);
39          bool operator==(const Page& page) const;
40 <        bool operator!=(const string& thing) { return !(*this == thing); }
40 >        bool operator!=(const ext::String& thing) { return !(*this == thing); }
41          bool operator!=(Matcher& matcher) { return !(*this == matcher); }
42          bool operator!=(const Page& page) const { return !(*this == page); }
43        bool operator<(const Page& page) const;
44        bool operator>(const Page& page) const;
43   // friends:
44 <        friend bool operator==(const string& thing, Page& page) { return page ==
45 <                thing; }
46 <        friend bool operator==(Matcher& matcher, Page& page) { return page ==
47 <                matcher; }
48 <        friend bool operator!=(const string& thing, Page& page) { return page !=
51 <                thing; }
52 <        friend bool operator!=(Matcher& matcher, Page& page) { return page !=
53 <                matcher; }
54 <        friend ostream& operator<<(ostream& output, Page& page);
44 >        friend bool operator==(const ext::String& thing, Page& page) { return page == thing; }
45 >        friend bool operator==(Matcher& matcher, Page& page) { return page == matcher; }
46 >        friend bool operator!=(const ext::String& thing, Page& page) { return page != thing; }
47 >        friend bool operator!=(Matcher& matcher, Page& page) { return page != matcher; }
48 >        friend xml::TextWriter& operator<<(xml::TextWriter& xml, Page& page);
49   };
50  
51   #endif // _Page_hpp_

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines