// Site Mapper // // Douglas Thrift // // $Id$ #ifndef _Page_hpp_ #define _Page_hpp_ #ifdef MENES_PRAGMA_ONCE #pragma once #endif class Matcher; class Page { private: cse::String address, path, title; ext::Vector children; cse::String childOf; public: Page() {} Page(const cse::String &address, const cse::String &path, const cse::String &title) : address(address), path(path), title(title) {} Page(const cse::String &url, const cse::String &title) : title(title) { SetUrl(url); } ~Page() {} cse::String &GetAddress() { return address; } cse::String &GetPath() { return path; } cse::String &GetTitle() { return title; } ext::Vector &GetChildren() { return children; } cse::String &GetChildOf() { return childOf; } cse::String GetUrl() const { return _S() << _B("http://") << address << path; } void SetAddress(const cse::String &address) { this->address = address; } void SetPath(const cse::String &path) { this->path = path; } void SetTitle(const cse::String &title) { this->title = title; } void SetChildren(ext::Vector &children) { this->children = children; } void SetChildOf(const cse::String &childOf) { this->childOf = childOf; } void SetUrl(const cse::String &url); bool operator==(const cse::String &thing); bool operator==(const Page &page) const; bool operator!=(const cse::String &thing) { return !(*this == thing); } bool operator!=(const Page &page) const { return !(*this == page); } // friends: friend bool operator==(const cse::String &thing, Page &page) { return page == thing; } friend bool operator!=(const cse::String &thing, Page &page) { return page != thing; } friend xml::TextWriter &operator<<(xml::TextWriter &xml, Page &page); }; #endif // _Page_hpp_