# HG changeset patch # User abarth93 # Date 1353360246 0 # Node ID cc196189bd61cc6596438de6cc41ce2573f84c45 # Parent f13ca602f603759161dd60b9a61160cae1146bcf add some doc diff -r f13ca602f603 -r cc196189bd61 extra/cgi/inst/@cgi/cgi.m --- a/extra/cgi/inst/@cgi/cgi.m Mon Nov 19 21:08:01 2012 +0000 +++ b/extra/cgi/inst/@cgi/cgi.m Mon Nov 19 21:24:06 2012 +0000 @@ -1,8 +1,16 @@ -% Create a CGI object to parse CGI query string. -% Only GET methods are currently handled. +%% -*- texinfo -*- +%% @deftypefn {Function File} {@var{CGI} =} cgi () +%% Create a CGI object to parse CGI query string from GET or POST requests. +%% +%% @end deftypefn +%% @seealso{getfirst,getlist} + + % -% CGI = cgi() +% CGI = cgi(); +% % Parameter can be return by: + % getfirst(CGI,name[,default]) % getlist(CGI,name) % CGI.form.name diff -r f13ca602f603 -r cc196189bd61 extra/cgi/inst/@cgi/getfirst.m --- a/extra/cgi/inst/@cgi/getfirst.m Mon Nov 19 21:08:01 2012 +0000 +++ b/extra/cgi/inst/@cgi/getfirst.m Mon Nov 19 21:24:06 2012 +0000 @@ -1,7 +1,15 @@ +%% -*- texinfo -*- +%% @deftypefn {Function File} {@var{val} =} getfirst(@var{cgi},@var{name}) +%% @deftypefnx {Function File} {@var{val} =} getfirst(@var{cgi},@var{name},@var{default}) +%% Returns the first CGI parameter with the given name. +%% If the CGI parameter is not found in the query string, then the +%% parameter @var{default} is returned if specified or an error is raised. +%% The object @var{cgi} was +%% created using the cgi() constructor. +%% @end deftypefn +%% @seealso{cgi} + % val = getfirst(cgi,name,default) -% Return the first CGI parameter with the given name. -% If the CGI parameter is not found in the query string, then the -% parameter default is returned if specified or an error is raised. function val = getfirst(cgi,name,default) diff -r f13ca602f603 -r cc196189bd61 extra/cgi/inst/@cgi/getlist.m --- a/extra/cgi/inst/@cgi/getlist.m Mon Nov 19 21:08:01 2012 +0000 +++ b/extra/cgi/inst/@cgi/getlist.m Mon Nov 19 21:24:06 2012 +0000 @@ -1,5 +1,9 @@ -% vals = getlist(cgi,name) -% Return all CGI parameters with the given name. +%% -*- texinfo -*- +%% @deftypefn {Function File} {@var{vals} =} getlist(@var{cgi},@var{name}) +%% Returns all CGI parameters with the given @var{name}. The object @var{cgi} was +%% created using the cgi() constructor. +%% @end deftypefn +%% @seealso{cgi} function vals = getlist(cgi,name) diff -r f13ca602f603 -r cc196189bd61 extra/cgi/inst/@cgi/subsref.m --- a/extra/cgi/inst/@cgi/subsref.m Mon Nov 19 21:08:01 2012 +0000 +++ b/extra/cgi/inst/@cgi/subsref.m Mon Nov 19 21:24:06 2012 +0000 @@ -1,4 +1,13 @@ -% Return parmaters with cgi.form.('param_name') +%% -*- texinfo -*- +%% @deftypefn {Function File} {@var{val} =} subsref(@var{cgi},@var{idx}) +%% @deftypefnx {Function File} {@var{val} =} getfirst(@var{cgi},@var{name},@var{default}) +%% Return CGI parmaters with cgi.form.name or cgi.form.('name'). +%% The object @var{cgi} was +%% created using the cgi() constructor. +%% @end deftypefn +%% @seealso{cgi} + + function val = subsref(self,idx) diff -r f13ca602f603 -r cc196189bd61 extra/cgi/inst/test_cgi.sh --- a/extra/cgi/inst/test_cgi.sh Mon Nov 19 21:08:01 2012 +0000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,8 +0,0 @@ -DOCUMENT_ROOT=/var/www QUERY_STRING="x=50%2C1,2&y=1,2,3&len=10&name=test&field=random_field" octave <