📄 aft_help.m
字号:
function ohelp = aft_Help(hfile, smeth)
% AnyFileType::Help - method for any BVQXfile type
%
% FORMAT: [helptext] = object.Help([methodname])
%
% Input fields:
%
% methodname if given, only the help for one method is returned
%
% Output fields:
%
% helptext 1xN char array describing all (or one) method(s)
% Version: v0.7b
% Build: 7082923
% Date: Aug-29 2007, 11:00 PM CEST
% Author: Jochen Weber, Brain Innovation, B.V., Maastricht, NL
% URL/Info: http://wiki.brainvoyager.com/BVQXtools
% only valid for single file
if nargin < 1 || ...
numel(hfile) ~= 1 || ...
~isBVQXfile(hfile, true)
error( ...
'BVQXfile:BadArgument', ...
'Invalid call to %s.', ...
mfilename ...
);
end
% get object super-struct
sc = bvqxfile_getscont(hfile.L);
% locate methods for this type
ftype = sc.S.Extensions{1};
meth = BVQXfile(0, 'methods');
if ~isfield(meth, lower(ftype))
ohelp = ['No methods for filetype ' upper(ftype) '.'];
return;
end
% get methods
ometh = meth.(lower(ftype));
mname = sort(fieldnames(ometh));
% only single method
if nargin > 1 && ...
ischar(smeth) && ...
~isempty(smeth) && ...
isfield(ometh, lower(smeth))
% get single methods help
mfile = ometh.(lower(smeth));
mhelp = help(['@BVQXfile/private/' mfile '.m']);
ohelp = gluetostring(splittocell(mhelp, char([10, 13]), 1, 1), char(10));
return;
end
% prepare output
ohelp = cell(2 + 4 * numel(mname), 1);
ohelp(1:2) = {['Methods for filetype ' upper(ftype) ':']; ''};
% iterate over methods
ohc = 3;
for mc = 1:numel(mname)
mfile = ometh.(mname{mc});
uscp = find(mfile == '_');
mshort = mfile(uscp(1)+1:end);
mhelp = help(['@BVQXfile/private/' mfile '.m']);
ohelp{ohc} = [upper(ftype) '::' mshort];
ohelp{ohc+1} = '';
ohelp{ohc+2} = gluetostring( ...
splittocell(mhelp, char([10, 13]), 1, 1), char(10));
ohelp{ohc+3} = char(10);
ohc = ohc + 4;
end
% glue to string
ohelp = gluetostring(ohelp, char(10));
% display help ?
if nargout < 1
disp(ohelp);
end
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -