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