added format and request method constants classes
+ license file
This commit is contained in:
86
library/protocol/http/src/http_format_constants.e
Normal file
86
library/protocol/http/src/http_format_constants.e
Normal file
@@ -0,0 +1,86 @@
|
||||
note
|
||||
description: "Summary description for {HTTP_FORMAT_CONSTANTS}."
|
||||
date: "$Date$"
|
||||
revision: "$Revision$"
|
||||
|
||||
class
|
||||
HTTP_FORMAT_CONSTANTS
|
||||
|
||||
feature -- Id
|
||||
|
||||
json: INTEGER = 0x1
|
||||
|
||||
xml: INTEGER = 0x2
|
||||
|
||||
text: INTEGER = 0x4
|
||||
|
||||
html: INTEGER = 0x8
|
||||
|
||||
rss: INTEGER = 0x10
|
||||
|
||||
atom: INTEGER = 0x20
|
||||
|
||||
feature -- Name
|
||||
|
||||
json_name: STRING = "json"
|
||||
|
||||
xml_name: STRING = "xml"
|
||||
|
||||
text_name: STRING = "text"
|
||||
|
||||
html_name: STRING = "html"
|
||||
|
||||
rss_name: STRING = "rss"
|
||||
|
||||
atom_name: STRING = "atom"
|
||||
|
||||
empty_name: STRING = ""
|
||||
|
||||
feature -- Query
|
||||
|
||||
format_id (a_id: STRING): INTEGER
|
||||
local
|
||||
s: STRING
|
||||
do
|
||||
s := a_id.as_lower
|
||||
if s.same_string (json_name) then
|
||||
Result := json
|
||||
elseif s.same_string (xml_name) then
|
||||
Result := xml
|
||||
elseif s.same_string (text_name) then
|
||||
Result := text
|
||||
elseif s.same_string (html_name) then
|
||||
Result := html
|
||||
elseif s.same_string (rss_name) then
|
||||
Result := rss
|
||||
elseif s.same_string (atom_name) then
|
||||
Result := atom
|
||||
end
|
||||
end
|
||||
|
||||
format_name (a_id: INTEGER): STRING
|
||||
do
|
||||
inspect a_id
|
||||
when json then Result := json_name
|
||||
when xml then Result := xml_name
|
||||
when text then Result := text_name
|
||||
when html then Result := html_name
|
||||
when rss then Result := rss_name
|
||||
when atom then Result := atom_name
|
||||
else Result := empty_name
|
||||
end
|
||||
ensure
|
||||
result_is_lower_case: Result /= Void and then Result.as_lower ~ Result
|
||||
end
|
||||
|
||||
note
|
||||
copyright: "Copyright (c) 1984-2011, Eiffel Software and others"
|
||||
license: "Eiffel Forum License v2 (see http://www.eiffel.com/licensing/forum.txt)"
|
||||
source: "[
|
||||
Eiffel Software
|
||||
5949 Hollister Ave., Goleta, CA 93117 USA
|
||||
Telephone 805-685-1006, Fax 805-685-6869
|
||||
Website http://www.eiffel.com
|
||||
Customer support http://support.eiffel.com
|
||||
]"
|
||||
end
|
||||
79
library/protocol/http/src/http_request_method_constants.e
Normal file
79
library/protocol/http/src/http_request_method_constants.e
Normal file
@@ -0,0 +1,79 @@
|
||||
note
|
||||
description: "Summary description for {HTTP_REQUEST_METHOD_CONSTANTS}."
|
||||
date: "$Date$"
|
||||
revision: "$Revision$"
|
||||
|
||||
class
|
||||
HTTP_REQUEST_METHOD_CONSTANTS
|
||||
|
||||
feature -- Id
|
||||
|
||||
method_get: INTEGER = 0x1
|
||||
|
||||
method_post: INTEGER = 0x2
|
||||
|
||||
method_put: INTEGER = 0x4
|
||||
|
||||
method_delete: INTEGER = 0x8
|
||||
|
||||
method_head: INTEGER = 0x10
|
||||
|
||||
feature -- Name
|
||||
|
||||
method_get_name: STRING = "GET"
|
||||
|
||||
method_post_name: STRING = "POST"
|
||||
|
||||
method_put_name: STRING = "PUT"
|
||||
|
||||
method_delete_name: STRING = "DELETE"
|
||||
|
||||
method_head_name: STRING = "HEAD"
|
||||
|
||||
method_empty_name: STRING = ""
|
||||
|
||||
feature -- Query
|
||||
|
||||
method_id (a_id: STRING): INTEGER
|
||||
local
|
||||
s: STRING
|
||||
do
|
||||
s := a_id.as_lower
|
||||
if s.same_string (method_get_name) then
|
||||
Result := method_get
|
||||
elseif s.same_string (method_post_name) then
|
||||
Result := method_post
|
||||
elseif s.same_string (method_put_name) then
|
||||
Result := method_put
|
||||
elseif s.same_string (method_delete_name) then
|
||||
Result := method_delete
|
||||
elseif s.same_string (method_head_name) then
|
||||
Result := method_head
|
||||
end
|
||||
end
|
||||
|
||||
method_name (a_id: INTEGER): STRING
|
||||
do
|
||||
inspect a_id
|
||||
when method_get then Result := method_get_name
|
||||
when method_post then Result := method_post_name
|
||||
when method_put then Result := method_put_name
|
||||
when method_delete then Result := method_delete_name
|
||||
when method_head then Result := method_head_name
|
||||
else Result := method_empty_name
|
||||
end
|
||||
ensure
|
||||
result_is_upper_case: Result /= Void and then Result.as_upper ~ Result
|
||||
end
|
||||
|
||||
note
|
||||
copyright: "Copyright (c) 1984-2011, Eiffel Software and others"
|
||||
license: "Eiffel Forum License v2 (see http://www.eiffel.com/licensing/forum.txt)"
|
||||
source: "[
|
||||
Eiffel Software
|
||||
5949 Hollister Ave., Goleta, CA 93117 USA
|
||||
Telephone 805-685-1006, Fax 805-685-6869
|
||||
Website http://www.eiffel.com
|
||||
Customer support http://support.eiffel.com
|
||||
]"
|
||||
end
|
||||
10
library/server/ewsgi/examples/hello_world/license.lic
Normal file
10
library/server/ewsgi/examples/hello_world/license.lic
Normal file
@@ -0,0 +1,10 @@
|
||||
${NOTE_KEYWORD}
|
||||
copyright: "2011-${YEAR}, Eiffel Software and others"
|
||||
license: "Eiffel Forum License v2 (see http://www.eiffel.com/licensing/forum.txt)"
|
||||
source: "[
|
||||
Eiffel Software
|
||||
5949 Hollister Ave., Goleta, CA 93117 USA
|
||||
Telephone 805-685-1006, Fax 805-685-6869
|
||||
Website http://www.eiffel.com
|
||||
Customer support http://support.eiffel.com
|
||||
]"
|
||||
Reference in New Issue
Block a user