2 %>@ingroup introspection
6 %> @brief Scans IRootLab directories and build hierarchical
class maps
13 methods(Static, Access=
private)
14 %===============================================================================
15 % Copyright (C) 2003 Guillaume Flandin <Guillaume@artefact.tk>
16 % (extracted from m2html.m)
18 % changed to
get files with
"new." in the name
19 function mfiles = getmfiles(mdirs,mfiles,recursive)
20 %- Extract M-files from a list of directories and/or M-files
23 if exist(mdirs{i}) == 2 % M-file
24 mfiles{end+1} = mdirs{i};
25 elseif exist(mdirs{i}) == 7 % Directory
27 w = w(1); %- Sometimes an array is returned...
30 %
if findstr(
'new.', w.m{j})
31 % mfiles{end+1} = fullfile(mdirs{i},w.m{j});
32 mfiles{end+1} = names{j};
37 d = {d([d.isdir]).name};
38 d = {d{~ismember(d,{
'.' '..'})}};
39 % [vals, idxs] = sort(d);
42 mfiles =
classmap.getmfiles(cellstr(fullfile(mdirs{i},d{j})),...
47 fprintf(
'Warning: Unprocessed file %s.\n',mdirs{i});
53 function res = find_item_by_name_(item, name)
55 if strcmp(item.name, name)
58 for i = 1:length(item.descendants)
59 res =
classmap.find_item_by_name_(item.descendants(i), name);
77 % Classname needs be a subdirectory of the IRootLab root folder
78 function o = build(o, classname)
89 for i = 1:length(files)
91 ss = textread(files{i},
'%s');
93 disp(
'wtfwtfwtfwtfwtfwtfwtfwtfwtfwtfwtfwtfwtfwtfwtfwtfwtfwtfwtf');
95 if ismember(
'classdef', ss)
96 disp([files{i}
'...']);
98 obj = eval(files{i}(1:end-2));
102 if obj.flag_ui && isa(obj, classname)
103 temp = superclasses(obj);
107 oo.color = obj.color;
108 oo.title = obj.classtitle;
109 oo.ancestor = temp{1};
112 oo.input = obj.inputclass;
118 list(cnt) = oo; % to organize later
119 names{cnt} = name; % to help find the classes
121 if strcmp(list(cnt).name, classname)
122 o.root.descendants(end+1) = list(cnt);
126 irverbose(['Failed mapping file ', files{i}(1:end-2),
'!!!!!!!!!!!!!!!!!!!!!!'], 3);
133 for i = 1:length(list)
134 if ~strcmp(list(i).name, classname)
135 [val, idx] = find(strcmp(names, list(i).ancestor));
137 irerror(sprintf('Ancestor ''%s'' for class ''%s'' not found!', list(i).ancestor, list(i).name));
139 % fprintf('********%s %d\n', list(i).ancestor, idx);
140 list(idx).descendants(end+1) = list(i);
141 list(i).parent = list(idx);
147 function item = find_item_by_name(o, name)
148 item =
classmap.find_item_by_name_(o.root, name);
function irverbose(in s, in level)
function classmap_compile()
function classmap_assert()
Scans IRootLab directories and build hierarchical class maps.