// Site Mapper // // Douglas Thrift // // $Id$ #ifndef _Page_hpp_ #define _Page_hpp_ #include "SiteMapper.hpp" class Matcher; class Page { private: ext::String address, path, title; ext::Vector children; ext::String childOf; public: Page() {} Page(const ext::String& address, const ext::String& path, const ext::String& title) : address(address), path(path), title(title) {} Page(const ext::String& url, const ext::String& title) : title(title) { setUrl(url); } ~Page() {} ext::String& getAddress() { return address; } ext::String& getPath() { return path; } ext::String& getTitle() { return title; } ext::Vector& getChildren() { return children; } ext::String& getChildOf() { return childOf; } ext::String getUrl() const { return ios::String() << "http://" << address << path; } void setAddress(const ext::String& address) { this->address = address; } void setPath(const ext::String& path) { this->path = path; } void setTitle(const ext::String& title) { this->title = title; } void setChildren(ext::Vector& children) { this->children = children; } void setChildOf(const ext::String& childOf) { this->childOf = childOf; } void setUrl(const ext::String& url); bool operator==(const ext::String& thing); bool operator==(Matcher& matcher); bool operator==(const Page& page) const; bool operator!=(const ext::String& thing) { return !(*this == thing); } bool operator!=(Matcher& matcher) { return !(*this == matcher); } bool operator!=(const Page& page) const { return !(*this == page); } // friends: friend bool operator==(const ext::String& thing, Page& page) { return page == thing; } friend bool operator==(Matcher& matcher, Page& page) { return page == matcher; } friend bool operator!=(const ext::String& thing, Page& page) { return page != thing; } friend bool operator!=(Matcher& matcher, Page& page) { return page != matcher; } friend xml::TextWriter& operator<<(xml::TextWriter& xml, Page& page); }; #endif // _Page_hpp_