// Site Mapper // // Douglas Thrift // // $Id$ #include "Matcher.hpp" #include "Page.hpp" Page::Page(const string& address, const string& path, const string& title) { setAddress(address); setPath(path); setTitle(title); } Page::Page(const string& url) { setUrl(url); } void Page::setUrl(const string& url) { Matcher matcher("^http://(.+)(/.*)?$"); if (url == matcher) { address = matcher[1]; if (matcher.size() > 2) { path = matcher[2]; } else { path = '/'; } } else { cerr << program << ": Page.setUrl(" << url << ") failure.\n"; exit(1); } } bool Page::operator==(const string& thing) { // return false; } bool Page::operator==(Page& page) { // return false; } bool Page::operator<(Page& page) { // return false; } bool Page::operator>(Page& page) { // return false; }