From: rich Date: Thu, 13 Jan 2005 16:06:04 +0000 (+0000) Subject: More filling in of method wrappers. X-Git-Url: http://git.annexia.org/?a=commitdiff_plain;h=1e204b159732a1162086091c0cf1ffb675c68217;p=perl4caml.git More filling in of method wrappers. --- diff --git a/.depend b/.depend index 40f224f..4ca9e5a 100644 --- a/.depend +++ b/.depend @@ -42,8 +42,10 @@ wrappers/pl_HTTP_Request.cmx: perl.cmx wrappers/pl_HTTP_Message.cmx \ wrappers/pl_URI.cmx wrappers/pl_HTTP_Request_Common.cmo: perl.cmi wrappers/pl_HTTP_Request.cmo wrappers/pl_HTTP_Request_Common.cmx: perl.cmx wrappers/pl_HTTP_Request.cmx -wrappers/pl_HTTP_Response.cmo: perl.cmi wrappers/pl_HTTP_Message.cmo -wrappers/pl_HTTP_Response.cmx: perl.cmx wrappers/pl_HTTP_Message.cmx +wrappers/pl_HTTP_Response.cmo: perl.cmi wrappers/pl_HTTP_Message.cmo \ + wrappers/pl_HTTP_Request.cmo +wrappers/pl_HTTP_Response.cmx: perl.cmx wrappers/pl_HTTP_Message.cmx \ + wrappers/pl_HTTP_Request.cmx wrappers/pl_LWP_UserAgent.cmo: perl.cmi wrappers/pl_HTTP_Cookies.cmo \ wrappers/pl_HTTP_Request.cmo wrappers/pl_HTTP_Response.cmo wrappers/pl_LWP_UserAgent.cmx: perl.cmx wrappers/pl_HTTP_Cookies.cmx \ diff --git a/wrappers/pl_HTTP_Request.ml b/wrappers/pl_HTTP_Request.ml index e194956..53c24a5 100644 --- a/wrappers/pl_HTTP_Request.ml +++ b/wrappers/pl_HTTP_Request.ml @@ -2,7 +2,7 @@ * * Copyright (C) 2003 Merjis Ltd. * - * $Id: pl_HTTP_Request.ml,v 1.3 2003-10-16 13:41:07 rich Exp $ + * $Id: pl_HTTP_Request.ml,v 1.4 2005-01-13 16:06:04 rich Exp $ *) open Perl @@ -23,6 +23,10 @@ object (self) string_of_sv (call_method sv "method" []) method set_method meth = call_method_void sv "method" [sv_of_string meth] + method uri = + string_of_sv (call_method sv "uri" []) + method set_uri uri = + call_method_void sv "uri" [sv_of_string uri] method as_string = string_of_sv (call_method sv "as_string" []) diff --git a/wrappers/pl_HTTP_Response.ml b/wrappers/pl_HTTP_Response.ml index 19b6641..5bc1e6e 100644 --- a/wrappers/pl_HTTP_Response.ml +++ b/wrappers/pl_HTTP_Response.ml @@ -2,12 +2,13 @@ * * Copyright (C) 2003 Merjis Ltd. * - * $Id: pl_HTTP_Response.ml,v 1.3 2003-10-16 13:41:07 rich Exp $ + * $Id: pl_HTTP_Response.ml,v 1.4 2005-01-13 16:06:04 rich Exp $ *) open Perl open Pl_HTTP_Message +open Pl_HTTP_Request let _ = eval "use HTTP::Response" @@ -24,6 +25,10 @@ object (self) string_of_sv (call_method sv "message" []) method set_message message = call_method_void sv "message" [sv_of_string message] + method request = + new http_request (call_method sv "request" []) + method set_request (req : http_request) = + call_method_void sv "request" [req#sv] method status_line = string_of_sv (call_method sv "status_line" []) method base = diff --git a/wrappers/pl_WWW_Mechanize.ml b/wrappers/pl_WWW_Mechanize.ml index 2582b9d..a0b5f60 100644 --- a/wrappers/pl_WWW_Mechanize.ml +++ b/wrappers/pl_WWW_Mechanize.ml @@ -2,7 +2,7 @@ * * Copyright (C) 2004 Merjis Ltd. * - * $Id: pl_WWW_Mechanize.ml,v 1.2 2004-11-26 13:33:10 rich Exp $ + * $Id: pl_WWW_Mechanize.ml,v 1.3 2005-01-13 16:06:04 rich Exp $ *) open Perl @@ -187,6 +187,10 @@ end (* XXX Should be able to pass args to constructor of LWP::UserAgent. *) (* XXX WWW::Mechanize has additional parameters. *) -let new_ () = - let sv = call_class_method "WWW::Mechanize" "new" [] in +let new_ ?autocheck () = + let args = ref [] in + let may f = function None -> () | Some v -> f v in + may (fun v -> + args := sv_of_string "autocheck" :: sv_of_bool v :: !args) autocheck; + let sv = call_class_method "WWW::Mechanize" "new" !args in new www_mechanize sv