ViewVC Help
View File | Revision Log | Show Annotations | Download File | View Changeset | Root Listing
root/repos/SiteMapperOld/Page.hpp
Revision: 141
Committed: 2004-03-25T19:21:58-08:00 (21 years, 2 months ago) by Douglas Thrift
Original Path: SiteMapper/Page.hpp
File size: 1814 byte(s)
Log Message:
Back to vectors, evil Microsoft! But, I'll use lists too! Ha!

File Contents

# User Rev Content
1 Douglas Thrift 128 // Site Mapper
2     //
3     // Douglas Thrift
4     //
5     // $Id$
6    
7     #ifndef _Page_hpp_
8     #define _Page_hpp_
9    
10     #include "SiteMapper.hpp"
11    
12 Douglas Thrift 140 class Matcher;
13    
14 Douglas Thrift 128 class Page
15     {
16     private:
17     string address;
18     string path;
19     string title;
20 Douglas Thrift 141 vector<Page> children;
21 Douglas Thrift 135 unsigned tab;
22 Douglas Thrift 128 public:
23     Page(const string& address, const string& path, const string& title);
24 Douglas Thrift 135 Page(const string& url, const string& title);
25 Douglas Thrift 128 ~Page() {}
26 Douglas Thrift 129 string& getAddress(void) { return address; }
27     string& getPath(void) { return path; }
28     string& getTitle(void) { return title; }
29 Douglas Thrift 141 vector<Page>& getChildren(void) { return children; }
30 Douglas Thrift 129 string getUrl(void) { return "http://" + address + path; }
31 Douglas Thrift 128 void setAddress(const string& address) { this->address = address; }
32     void setPath(const string& path) { this->path = path; }
33     void setTitle(const string& title) { this->title = title; }
34 Douglas Thrift 141 void setChildren(vector<Page>& children) { this->children = children; }
35 Douglas Thrift 128 void setUrl(const string& url);
36 Douglas Thrift 135 Page& operator()(unsigned tab) { this->tab = tab; return *this; }
37 Douglas Thrift 129 bool operator==(const string& thing);
38 Douglas Thrift 140 bool operator==(Matcher& matcher);
39     bool operator==(const Page& page) const;
40 Douglas Thrift 129 bool operator!=(const string& thing) { return !(*this == thing); }
41 Douglas Thrift 140 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;
45 Douglas Thrift 128 // friends:
46 Douglas Thrift 129 friend bool operator==(const string& thing, Page& page) { return page ==
47     thing; }
48 Douglas Thrift 140 friend bool operator==(Matcher& matcher, Page& page) { return page ==
49     matcher; }
50     friend bool operator!=(const string& thing, Page& page) { return page !=
51 Douglas Thrift 129 thing; }
52 Douglas Thrift 140 friend bool operator!=(Matcher& matcher, Page& page) { return page !=
53     matcher; }
54 Douglas Thrift 135 friend ostream& operator<<(ostream& output, Page& page);
55 Douglas Thrift 128 };
56    
57     #endif // _Page_hpp_

Properties

Name Value
svn:eol-style native
svn:keywords Id