1 |
// Url |
2 |
// |
3 |
// Douglas Thrift |
4 |
// |
5 |
// $Id$ |
6 |
|
7 |
#include <cxx/standard.hh> |
8 |
|
9 |
#include "Url.hpp" |
10 |
|
11 |
cse::String Url::GetModified() const |
12 |
{ |
13 |
ext::Buffer buffer(22); |
14 |
|
15 |
size_t size(::strftime(buffer.Begin(), buffer.GetSize(), "%FT%TTZ", modified)); |
16 |
|
17 |
buffer.SetSize(size); |
18 |
|
19 |
return buffer; |
20 |
} |
21 |
|
22 |
cse::String Url::GetFrequency() const |
23 |
{ |
24 |
switch (frequency) |
25 |
{ |
26 |
case always: |
27 |
return _B("always"); |
28 |
case hourly: |
29 |
return _B("hourly"); |
30 |
case daily: |
31 |
return _B("daily"); |
32 |
case weekly: |
33 |
return _B("weekly"); |
34 |
case monthly: |
35 |
return _B("monthly"); |
36 |
case yearly: |
37 |
return _B("yearly"); |
38 |
case never: |
39 |
return _B("never"); |
40 |
_nodefault |
41 |
} |
42 |
} |
43 |
|
44 |
cse::String Url::GetPriority() const |
45 |
{ |
46 |
_assert (priority < 11); |
47 |
|
48 |
switch (priority) |
49 |
{ |
50 |
default: |
51 |
return _S<ios::String>() << _B("0.") << priority; |
52 |
case 10: |
53 |
return _B("1.0"); |
54 |
} |
55 |
} |