ViewVC Help
View File | Revision Log | Show Annotations | Download File | View Changeset | Root Listing
root/repos/SiteMapperOld/Page.cpp
Revision: 128
Committed: 2004-03-23T22:15:08-08:00 (21 years, 3 months ago) by Douglas Thrift
Original Path: SiteMapper/Page.cpp
File size: 551 byte(s)
Log Message:
Moving right along!

File Contents

# User Rev Content
1 Douglas Thrift 128 // Site Mapper
2     //
3     // Douglas Thrift
4     //
5     // $Id$
6    
7     #include "Page.hpp"
8    
9     Page::Page(const string& address, const string& path, const string& title)
10     {
11     setAddress(address);
12     setPath(path);
13     setTitle(title);
14     }
15    
16     Page::Page(const string& url)
17     {
18     setUrl(url);
19     }
20    
21     void Page::setUrl(const string& url)
22     {
23     Matcher matcher("^http://(.+)(/.*)?$");
24    
25     if (url == matcher)
26     {
27     address = matcher[1];
28    
29     if (matcher.size() > 2)
30     {
31     path = matcher[2];
32     }
33     else
34     {
35     path = '/';
36     }
37     }
38     else
39     {
40     cerr << program << ": Page.setUrl(" << url << ") failure.\n";
41     }
42     }

Properties

Name Value
svn:eol-style native
svn:keywords Id