Home > classes > @plist > char.m

char

PURPOSE ^

CHAR convert a parameter list into a string.

SYNOPSIS ^

function varargout = char(varargin)

DESCRIPTION ^

 CHAR convert a parameter list into a string.
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

 DESCRIPTION: CHAR convert a parameter list into a string.

 CALL:        string = char(plist);

 M-FILE INFO: Get information about this methods by calling
              >> plist.getInfo('char')

              Get information about a specified set-plist by calling:
              >> plist.getInfo('char', 'set')

 VERSION:     $Id: char.m,v 1.21 2008/09/04 15:29:31 ingo Exp $

 HISTORY:     04-02-2007 M Hewitson
                 Creation

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

CROSS-REFERENCE INFORMATION ^

This function calls: This function is called by:

SUBFUNCTIONS ^

SOURCE CODE ^

0001 % CHAR convert a parameter list into a string.
0002 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
0003 %
0004 % DESCRIPTION: CHAR convert a parameter list into a string.
0005 %
0006 % CALL:        string = char(plist);
0007 %
0008 % M-FILE INFO: Get information about this methods by calling
0009 %              >> plist.getInfo('char')
0010 %
0011 %              Get information about a specified set-plist by calling:
0012 %              >> plist.getInfo('char', 'set')
0013 %
0014 % VERSION:     $Id: char.m,v 1.21 2008/09/04 15:29:31 ingo Exp $
0015 %
0016 % HISTORY:     04-02-2007 M Hewitson
0017 %                 Creation
0018 %
0019 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
0020 
0021 function varargout = char(varargin)
0022 
0023   %%% Check if this is a call for parameters
0024   if utils.helper.isinfocall(varargin{:})
0025     varargout{1} = getInfo(varargin{3});
0026     return
0027   end
0028 
0029   objs = utils.helper.collect_objects(varargin(:), 'plist');
0030 
0031   pstr = '';
0032   for ii = 1:numel(objs)
0033     pl = objs(ii);
0034     if ~isempty(pl.params)
0035       pstr = [pstr '(' char(pl.params) '), '];
0036     else
0037       pstr = [pstr '(empty-plist), '];
0038     end
0039   end
0040 
0041   if length(pstr)>1
0042     pstr = pstr(1:end-2);
0043   else
0044     pstr = '(empty-plist)';
0045   end
0046 
0047   %%% Prepare output
0048   varargout{1} = pstr;
0049 end
0050 
0051 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
0052 %                               Local Functions                               %
0053 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
0054 
0055 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
0056 %
0057 % FUNCTION:    getInfo
0058 %
0059 % DESCRIPTION: Get Info Object
0060 %
0061 % HISTORY:     11-07-07 M Hewitson
0062 %                Creation.
0063 %
0064 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
0065 
0066 function ii = getInfo(varargin)
0067   if nargin == 1 && strcmpi(varargin{1}, 'None')
0068     sets = {};
0069     pl   = [];
0070   else
0071     sets = {'Default'};
0072     pl   = getDefaultPlist;
0073   end
0074   % Build info object
0075   ii = minfo(mfilename, 'plist', '', utils.const.categories.output, '$Id: char.m,v 1.21 2008/09/04 15:29:31 ingo Exp $', sets, pl);
0076 end
0077 
0078 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
0079 %
0080 % FUNCTION:    getDefaultPlist
0081 %
0082 % DESCRIPTION: Get Default Plist
0083 %
0084 % HISTORY:     11-07-07 M Hewitson
0085 %                Creation.
0086 %
0087 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
0088 
0089 function plo = getDefaultPlist()
0090   plo = plist();
0091 end
0092

Generated on Mon 08-Sep-2008 13:18:47 by m2html © 2003