-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathrequest_uri.e
More file actions
67 lines (54 loc) · 874 Bytes
/
request_uri.e
File metadata and controls
67 lines (54 loc) · 874 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
note
description: "Summary description for {REQUEST_URI}."
author: ""
date: "$Date$"
revision: "$Revision$"
class
REQUEST_URI
inherit
ANY
redefine
out
end
create
star, absolute, relative
feature
star
do
is_star := True
end
is_star: BOOLEAN
absolute (a_host: STRING; a_resource: STRING)
do
is_absolute := True
host := a_host
resource := a_resource
end
relative (a_str: STRING)
do
is_absolute := False
resource := a_str.twin
end
is_absolute: BOOLEAN
host: STRING
resource: STRING
extension: STRING
local
i: INTEGER
do
i := resource.last_index_of ('.', resource.count)
if i /= 0 then
Result := resource.substring (i+1, 1)
end
end
out: STRING
do
if is_star then
Result := "*"
elseif is_absolute then
Result := host + resource
else
Result := resource
end
end
end