diff libinterp/octave-value/ov-struct.cc @ 19276:1fa328da03ef

Overhaul getfield, setfield, orderfields m-files. * ov-struct.cc (Fstruct): Add seealso link to isfield in docstring. * ov-struct.cc (Frmfield): Add seealso link to isfield in docstring. * ov-struct.cc (Fisfield): Add newline between first sentence description of function and remainder of docstring. * getfield.m: Redo docstring. Match function variable names to documentation names. Place input validation first in function. Add input validation BIST tests. * orderfields.m: Redo docstring. Clarify error() messages. Add additional error message if second argument is not of the required type. Return an empty struct of the same size as the empty struct input. Add input validation BIST tests. * setfield.m: Redo docstring. Match function variable names to documentation names. Place input validation first in function. Add input validation BIST tests.
author Rik <rik@octave.org>
date Tue, 21 Oct 2014 09:57:02 -0700
parents 6113e0c6920b
children 76478d2da117
line wrap: on
line diff
--- a/libinterp/octave-value/ov-struct.cc	Tue Oct 21 09:39:03 2014 -0700
+++ b/libinterp/octave-value/ov-struct.cc	Tue Oct 21 09:57:02 2014 -0700
@@ -1814,7 +1814,7 @@
 \n\
 Finally, if the value is a non-scalar cell array, then @code{struct}\n\
 produces a struct @strong{array}.\n\
-@seealso{cell2struct, fieldnames, orderfields, getfield, setfield, rmfield, structfun}\n\
+@seealso{cell2struct, fieldnames, getfield, setfield, rmfield, isfield, orderfields, isstruct, structfun}\n\
 @end deftypefn")
 {
   octave_value retval;
@@ -2012,8 +2012,10 @@
 @deftypefn  {Built-in Function} {} isfield (@var{x}, \"@var{name}\")\n\
 @deftypefnx {Built-in Function} {} isfield (@var{x}, @var{name})\n\
 Return true if the @var{x} is a structure and it includes an element named\n\
-@var{name}.  If @var{name} is a cell array of strings then a logical array of\n\
-equal dimension is returned.\n\
+@var{name}.\n\
+\n\
+If @var{name} is a cell array of strings then a logical array of equal\n\
+dimension is returned.\n\
 @seealso{fieldnames}\n\
 @end deftypefn")
 {
@@ -2237,12 +2239,14 @@
 
 DEFUN (rmfield, args, ,
        "-*- texinfo -*-\n\
-@deftypefn  {Built-in Function} {@var{s} =} rmfield (@var{s}, \"@var{f}\")\n\
-@deftypefnx {Built-in Function} {@var{s} =} rmfield (@var{s}, @var{f})\n\
+@deftypefn  {Built-in Function} {@var{sout} =} rmfield (@var{s}, \"@var{f}\")\n\
+@deftypefnx {Built-in Function} {@var{sout} =} rmfield (@var{s}, @var{f})\n\
 Return a @emph{copy} of the structure (array) @var{s} with the field @var{f}\n\
-removed.  If @var{f} is a cell array of strings or a character array, remove\n\
-each of the named fields.\n\
-@seealso{orderfields, fieldnames}\n\
+removed.\n\
+\n\
+If @var{f} is a cell array of strings or a character array, remove each of\n\
+the named fields.\n\
+@seealso{orderfields, fieldnames, isfield}\n\
 @end deftypefn")
 {
   octave_value retval;