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 135 by Douglas Thrift, 2004-03-25T01:02:24-08:00 vs.
Revision 329 by douglas, 2004-12-13T20:16:22-08:00

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

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines