ViewVC Help
View File | Revision Log | Show Annotations | Download File | View Changeset | Root Listing
root/repos/SiteMapper/Page.hpp
Revision: 312
Committed: 2004-12-13T15:01:12-08:00 (20 years, 6 months ago) by douglas
File size: 2027 byte(s)
Log Message:
This might be a little more sane.

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 312 #include "SiteMapper.hpp"
11    
12 douglas 299 #ifdef MENES_PRAGMA_ONCE
13     #pragma once
14     #endif
15    
16 Douglas Thrift 140 class Matcher;
17    
18 Douglas Thrift 128 class Page
19     {
20     private:
21 douglas 285 ext::String address, path, title;
22     ext::Vector<Page> children;
23     ext::String childOf;
24 Douglas Thrift 128 public:
25 douglas 285 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 Douglas Thrift 128 ~Page() {}
29 douglas 285 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 Douglas Thrift 140 bool operator==(Matcher& matcher);
43     bool operator==(const Page& page) const;
44 douglas 285 bool operator!=(const ext::String& thing) { return !(*this == thing); }
45 Douglas Thrift 140 bool operator!=(Matcher& matcher) { return !(*this == matcher); }
46     bool operator!=(const Page& page) const { return !(*this == page); }
47 Douglas Thrift 128 // friends:
48 douglas 285 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 Douglas Thrift 128 };
54    
55     #endif // _Page_hpp_

Properties

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