ViewVC Help
View File | Revision Log | Show Annotations | Download File | View Changeset | Root Listing
root/repos/SiteMapperOld/Page.hpp
Revision: 425
Committed: 2005-03-10T20:06:50-08:00 (20 years, 4 months ago) by douglas
File size: 1919 byte(s)
Log Message:
Wow, not that I even use this one anymore!

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 Douglas Thrift 140 class Matcher;
11    
12 Douglas Thrift 128 class Page
13     {
14     private:
15 douglas 425 std::string address, path, title;
16     std::vector<Page> children;
17     std::string childOf;
18 Douglas Thrift 135 unsigned tab;
19 Douglas Thrift 128 public:
20 douglas 425 Page(const std::string& address, const std::string& path, const std::string& title);
21     Page(const std::string& url, const std::string& title);
22 Douglas Thrift 128 ~Page() {}
23 douglas 425 std::string& getAddress() { return address; }
24     std::string& getPath() { return path; }
25     std::string& getTitle() { return title; }
26     std::vector<Page>& getChildren() { return children; }
27     std::string& getChildOf() { return childOf; }
28     std::string getUrl() { return "http://" + address + path; }
29     void setAddress(const std::string& address) { this->address = address; }
30     void setPath(const std::string& path) { this->path = path; }
31     void setTitle(const std::string& title) { this->title = title; }
32     void setChildren(std::vector<Page>& children) { this->children = children; }
33     void setChildOf(const std::string& childOf) { this->childOf = childOf; }
34     void setUrl(const std::string& url);
35 Douglas Thrift 135 Page& operator()(unsigned tab) { this->tab = tab; return *this; }
36 douglas 425 bool operator==(const std::string& thing);
37 Douglas Thrift 140 bool operator==(Matcher& matcher);
38     bool operator==(const Page& page) const;
39 douglas 425 bool operator!=(const std::string& thing) { return !(*this == thing); }
40 Douglas Thrift 140 bool operator!=(Matcher& matcher) { return !(*this == matcher); }
41     bool operator!=(const Page& page) const { return !(*this == page); }
42 Douglas Thrift 128 // friends:
43 douglas 425 friend bool operator==(const std::string& thing, Page& page) { return page == thing; }
44     friend bool operator==(Matcher& matcher, Page& page) { return page == matcher; }
45     friend bool operator!=(const std::string& thing, Page& page) { return page != thing; }
46     friend bool operator!=(Matcher& matcher, Page& page) { return page != matcher; }
47     friend std::ostream& operator<<(std::ostream& output, Page& page);
48 Douglas Thrift 128 };
49    
50     #endif // _Page_hpp_

Properties

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