view m-toolbox/classes/@minfo/char.m @ 0:f0afece42f48

Import.
author Daniele Nicolodi <nicolodi@science.unitn.it>
date Wed, 23 Nov 2011 19:22:13 +0100
parents
children
line wrap: on
line source

% CHAR convert an minfo object into a string.
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%
% DESCRIPTION: CHAR convert an minfo object into a string.
%
% CALL:        string = char(obj)
%
% VERSION:     $Id: char.m,v 1.7 2011/02/18 16:48:53 ingo Exp $
%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

function varargout = char(varargin)

  objs = utils.helper.collect_objects(varargin(:), 'minfo');

  pstr = '';
  for ii = 1:numel(objs)

    pp   = objs(ii);
    % method class
    pstr = [pstr  sprintf('%s/', pp.mclass)];
    % method name
    pstr = [pstr  sprintf('%s', pp.mname)];
    % method category
    pstr = [pstr  sprintf(', %s', pp.mcategory)];
    % method sets
    if ~isempty(pp.sets)
      pstr = [pstr  sprintf(', %s', utils.prog.cell2str(pp.sets))];
    end
  end

  %%% Prepare output
  varargout{1} = pstr;
end