// Site Mapper // // Douglas Thrift // // $Id$ #ifndef _Page_hpp_ #define _Page_hpp_ #include "SiteMapper.hpp" class Matcher; class Page { private: string address; string path; string title; vector children; string childOf; unsigned tab; public: Page(const string& address, const string& path, const string& title); Page(const string& url, const string& title); ~Page() {} string& getAddress(void) { return address; } string& getPath(void) { return path; } string& getTitle(void) { return title; } vector& getChildren(void) { return children; } string& getChildOf(void) { return childOf; } string getUrl(void) { return "http://" + address + path; } void setAddress(const string& address) { this->address = address; } void setPath(const string& path) { this->path = path; } void setTitle(const string& title) { this->title = title; } void setChildren(vector& children) { this->children = children; } void setChildOf(const string& childOf) { this->childOf = childOf; } void setUrl(const string& url); Page& operator()(unsigned tab) { this->tab = tab; return *this; } bool operator==(const string& thing); bool operator==(Matcher& matcher); bool operator==(const Page& page) const; bool operator!=(const 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 string& thing, Page& page) { return page == thing; } friend bool operator==(Matcher& matcher, Page& page) { return page == matcher; } friend bool operator!=(const string& thing, Page& page) { return page != thing; } friend bool operator!=(Matcher& matcher, Page& page) { return page != matcher; } friend ostream& operator<<(ostream& output, Page& page); }; #endif // _Page_hpp_