PageRenderTime 148ms CodeModel.GetById 145ms app.highlight 1ms RepoModel.GetById 1ms app.codeStats 0ms

/library/client/rest/src/rest_service_api_parameters.e

http://github.com/jocelyn/EiffelWebReloaded
Specman e | 70 lines | 49 code | 15 blank | 6 comment | 1 complexity | 956ec65f8386c1bc5fea44f613f761d1 MD5 | raw file
 1note
 2	description: "Summary description for {REST_SERVICE_API_PARAMETERS}."
 3	author: ""
 4	date: "$Date$"
 5	revision: "$Revision$"
 6
 7class
 8	REST_SERVICE_API_PARAMETERS
 9
10create {REST_SERVICE_API}
11	make
12
13feature {NONE} -- Initialization
14
15	make (a_get_capacity, a_post_capacity: INTEGER)
16			-- Initialize for `a_get_capacity' GET params, and `a_post_capacity' POST params
17		do
18			create parameters_get.make (a_get_capacity)
19			create parameters_post.make (a_post_capacity)
20		end
21
22feature -- Status report
23
24	has_post: BOOLEAN
25		do
26			Result := not parameters_post.is_empty
27		end
28
29feature -- Element change
30
31	add_get_parameter (n: STRING; v: STRING)
32			-- Add GET parameter named `n' with value `v'
33		do
34			parameters_get.force (v,n)
35		end
36
37	add_post_parameter (n: STRING; v: STRING)
38			-- Add POST parameter named `n' with value `v'	
39		do
40			parameters_post.force (v,n)
41		end
42
43feature -- Clear
44
45	clear
46			-- Clear all parameters
47		do
48			parameters_get.wipe_out
49			parameters_post.wipe_out
50		end
51
52feature -- Access
53
54	parameters_get: HASH_TABLE [STRING, STRING]
55			-- GET parameters data
56
57	parameters_post: HASH_TABLE [STRING, STRING]
58			-- POST parameters data	
59
60;note
61	copyright: "Copyright (c) 1984-2011, Eiffel Software and others"
62	license: "Eiffel Forum License v2 (see http://www.eiffel.com/licensing/forum.txt)"
63	source: "[
64			Eiffel Software
65			5949 Hollister Ave., Goleta, CA 93117 USA
66			Telephone 805-685-1006, Fax 805-685-6869
67			Website http://www.eiffel.com
68			Customer support http://support.eiffel.com
69		]"
70end