From 874677ab7a0fe126e42c0f02186b4b19aba8c3fe Mon Sep 17 00:00:00 2001 From: Jocelyn Fiat Date: Fri, 23 Mar 2012 19:00:49 +0100 Subject: [PATCH] Renamed same_media_type as same_simple_type Added comments --- library/protocol/http/src/http_media_type.e | 25 ++++++++++++------- ...pplication_x_www_form_urlencoded_handler.e | 2 +- .../mime/wsf_multipart_form_data_handler.e | 2 +- 3 files changed, 18 insertions(+), 11 deletions(-) diff --git a/library/protocol/http/src/http_media_type.e b/library/protocol/http/src/http_media_type.e index fed5c4de..7674bb2b 100644 --- a/library/protocol/http/src/http_media_type.e +++ b/library/protocol/http/src/http_media_type.e @@ -115,12 +115,14 @@ feature {NONE} -- Initialization not has_error implies (create {HTTP_CONTENT_TYPE}.make_from_string (string)).same_string (string) end -feature -- Access +feature -- Status report has_error: BOOLEAN -- Current has error? --| Mainly in relation with `make_from_string' +feature -- Access + type: READABLE_STRING_8 -- Main type @@ -144,6 +146,7 @@ feature -- Access end parameters: detachable HASH_TABLE [READABLE_STRING_8, READABLE_STRING_8] + -- Parameters feature -- Conversion @@ -194,15 +197,10 @@ feature -- Conversion Result := res end -feature {NONE} -- Internal - - internal_string: detachable STRING_8 - - internal_simple_type: detachable STRING_8 - feature -- Status report same_as (other: HTTP_CONTENT_TYPE): BOOLEAN + -- Current has same type/subtype and parameters as `other'? local plst,oplst: like parameters do @@ -228,12 +226,14 @@ feature -- Status report end end - same_media_type (s: READABLE_STRING_8): BOOLEAN + same_simple_type (s: READABLE_STRING_8): BOOLEAN + -- Current has same type/subtype string representation as `s'? do Result := simple_type.same_string (s) end same_string (s: READABLE_STRING_8): BOOLEAN + -- Current has same string representation as `s'? do Result := string.same_string (s) end @@ -255,7 +255,7 @@ feature -- Element change end remove_parameter (a_name: READABLE_STRING_8) - -- Remove parameter + -- Remove parameter named `a_name' do if attached parameters as plst then plst.prune (a_name) @@ -269,6 +269,7 @@ feature -- Element change feature {NONE} -- Implementation add_parameter_from_string (s: READABLE_STRING_8; start_index, end_index: INTEGER) + -- Add parameter from string " attribute=value " local pn,pv: STRING_8 i: INTEGER @@ -308,6 +309,12 @@ feature {NONE} -- Implementation has_error := has_error or err end +feature {NONE} -- Internal + + internal_string: detachable STRING_8 + + internal_simple_type: detachable STRING_8 + feature -- Status report debug_output: STRING diff --git a/library/server/wsf/src/mime/wsf_application_x_www_form_urlencoded_handler.e b/library/server/wsf/src/mime/wsf_application_x_www_form_urlencoded_handler.e index d2afeca0..2dc0340d 100644 --- a/library/server/wsf/src/mime/wsf_application_x_www_form_urlencoded_handler.e +++ b/library/server/wsf/src/mime/wsf_application_x_www_form_urlencoded_handler.e @@ -16,7 +16,7 @@ feature -- Status report valid_content_type (a_content_type: HTTP_CONTENT_TYPE): BOOLEAN do - Result := a_content_type.same_media_type ({HTTP_MIME_TYPES}.application_x_www_form_encoded) + Result := a_content_type.same_simple_type ({HTTP_MIME_TYPES}.application_x_www_form_encoded) end feature -- Execution diff --git a/library/server/wsf/src/mime/wsf_multipart_form_data_handler.e b/library/server/wsf/src/mime/wsf_multipart_form_data_handler.e index ae21da12..eab6fabb 100644 --- a/library/server/wsf/src/mime/wsf_multipart_form_data_handler.e +++ b/library/server/wsf/src/mime/wsf_multipart_form_data_handler.e @@ -26,7 +26,7 @@ feature -- Status report valid_content_type (a_content_type: HTTP_CONTENT_TYPE): BOOLEAN do - Result := a_content_type.same_media_type ({HTTP_MIME_TYPES}.multipart_form_data) + Result := a_content_type.same_simple_type ({HTTP_MIME_TYPES}.multipart_form_data) end feature -- Execution