3 % prints out
class structure and documentation for a given classname or object
5 % The information printed by
this function includes
7 % - names of superclasses,
13 % classname_or_object: Either a
string holding the
class name or a class
14 % object,
for which information shall be printed.
15 %
verbose : Integer triggering the amount of information which is
17 % -
'0' - print parameter and method names,
18 % -
'1' - print parameter and method names (including
20 % -
'2' - print parameter and method names and their
21 % documentation strings,
22 % -
'3' - print parameter and method names and their
23 % documentation strings (including inherited
24 % parameters and methods).
30 if ischar(classname_or_object)
31 metainfo = eval(['?',classname_or_object]);
33 metainfo = metaclass(classname_or_object);
39 helpstr = @(X) sprintf('\n %s',strrep(evalc(['help ', X]), sprintf('\n'), sprintf('\n ')));
44 disp(['CLASS NAME: ', metainfo.Name]);
49 inherits =
char( cellfun(@(X) [X.Name, ' '], ...
50 metainfo.SuperClasses, ...
51 'UniformOutput', false));
52 disp(['Inherits from: ' inherits]);
56 meths = metainfo.Methods(...
57 cellfun(@(X) strcmp(X.DefiningClass.Name,cn)==1, metainfo.Methods, 'UniformOutput',true));
58 props = metainfo.Properties(...
59 cellfun(@(X) strcmp(X.DefiningClass.Name,cn)==1, metainfo.Properties, 'UniformOutput',true));
61 meths = metainfo.Methods;
62 props = metainfo.Properties;
65 proplist = cellfun(@(X) sprintf('%s%s', ...
67 helpstr([cn, '.', X.Name])), ...
69 'UniformOutput', false);
77 cellfun(@disp, proplist);
79 methlist = cellfun(@(X) sprintf('%s%s', ...
81 helpstr([cn, '.', X.Name])), ...
83 'UniformOutput', false);
91 cellfun(@disp, methlist);
function class_help(classname_or_object, verbose)
prints out class structure and documentation for a given classname or object
function r = verbose(level, message, messageId)
This function displays messages depending on a message-id and/or a level. Aditionally you can set/res...