changeset 11248:cc196189bd61 octave-forge

add some doc
author abarth93
date Mon, 19 Nov 2012 21:24:06 +0000
parents f13ca602f603
children b9b0592d2c87
files extra/cgi/inst/@cgi/cgi.m extra/cgi/inst/@cgi/getfirst.m extra/cgi/inst/@cgi/getlist.m extra/cgi/inst/@cgi/subsref.m extra/cgi/inst/test_cgi.sh
diffstat 5 files changed, 38 insertions(+), 17 deletions(-) [+]
line wrap: on
line diff
--- 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
--- 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)
 
--- 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)
 
--- 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)
 
--- 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 <<EOF
-addpath('/home/abarth/Octave/octave-forge/extra/cgi/inst/');
-
-CGI = cgi()
-cgi.form.y
-
-
-EOF
\ No newline at end of file