0001 function fiff_list_dir_tree(out, tree, indent)
0002
0003
0004
0005
0006
0007
0008
0009
0010
0011
0012
0013
0014
0015
0016
0017
0018
0019
0020
0021
0022
0023 global FIFF;
0024 if isempty(FIFF)
0025 FIFF = fiff_define_constants();
0026 end
0027
0028 me = 'MNE:fiff_list_dir_tree';
0029
0030 if nargin == 2
0031 indent = 0;
0032 end
0033
0034 for k = 1:indent
0035 fprintf(out, '\t');
0036 end
0037 if tree.block ~= 0
0038 fprintf(out, '{ %d\n', tree.block);
0039 end
0040
0041 count = 1;
0042 for k = 1:tree.nent
0043 if k == 1
0044 print = true;
0045 for p = 1:indent
0046 fprintf(out, '\t');
0047 end
0048 fprintf(out, 'tag : %d', tree.dir(k).kind);
0049 else
0050 if tree.dir(k).kind == tree.dir(k - 1).kind
0051 count = count + 1;
0052 else
0053 if count > 1
0054 fprintf(out, ' [%d]\n', count);
0055 else
0056 fprintf(out, '\n');
0057 end
0058 for p = 1:indent
0059 fprintf(out, '\t');
0060 end
0061 fprintf(out, 'tag : %d', tree.dir(k).kind);
0062 count = 1;
0063 end
0064 end
0065 end
0066 if count > 1
0067 fprintf(out, ' [%d]\n', count);
0068 else
0069 fprintf(out, '\n');
0070 end
0071
0072 for k = 1:tree.nchild
0073 fiff_list_dir_tree(out, tree.children(k), indent + 1);
0074 end
0075
0076 for k = 1:indent
0077 fprintf(out, '\t');
0078 end
0079
0080 if tree.block ~= 0
0081 fprintf(out, '} %d\n', tree.block);
0082 end
0083
0084 return
0085