ViewVC Help
View File | Revision Log | Show Annotations | Download File | View Changeset | Root Listing
root/repos/SiteMapper/Page.hpp
Revision: 299
Committed: 2004-12-12T16:39:07-08:00 (20 years, 6 months ago) by douglas
File size: 2027 byte(s)
Log Message:
May actually work on Windows, probably not.

File Contents

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

Properties

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