Home > classes > @minfo > char.m

char

PURPOSE ^

CHAR convert an minfo object into a string.

SYNOPSIS ^

function varargout = char(varargin)

DESCRIPTION ^

 CHAR convert an minfo object into a string.
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

 DESCRIPTION: CHAR convert an minfo object into a string.

 CALL:        string = char(obj)

 CALL FOR PARAMETERS:

              obj.char('INFO') % Struct with all function parameters

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

 HISTORY:     04-06-2008 M Hewitson
                 Creation

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

CROSS-REFERENCE INFORMATION ^

This function calls: This function is called by:

SUBFUNCTIONS ^

SOURCE CODE ^

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

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