4 if strcmp(roboRoot,'NULL')
5 robolog('Run "robochameleon" to initialize the robochameloen path.', 'ERR');
8 excludePaths = '\.git|user manual'; %Regexp format
10 searchTerm = varargin{1};
11 searchTerm = strrep(searchTerm,
'*',
'.*'); % * match all, shell style
13 if length(varargin) > 1
14 if strcmp(varargin{2},
'c')
15 %Search only
for classes
19 fileList = getAllFiles(roboRoot);
21 for i=1:length(fileList)
22 [fpath, namee] = fileparts(fileList{i});
23 if isempty(regexp(fpath, excludePaths,
'once'))
24 if ~isempty(regexp(namee, searchTerm, 'once'))
25 if classOnly && ~(exist(namee, 'class') == 8)
28 if isempty(fullName) || strcmp(namee, searchTerm)
29 % Do this on the first match and also if the file name matches COMPLETELY the
32 elseif isempty(regexp(searchTerm, '[tTest]', 'once')) && ...
33 ~isempty(regexp(namee, '[tT]est', 'once'))
34 % This will avoid the
unit testers to match as duplicate, but if we are looking for a
35 %
unit tester it will fail if there are multiple matches of the search term.
38 robolog('Search query matches multiple classes/files. Ignoring %s.', 'WRN', namee);
43 robolog('Opening documentation for class %s', fullName);
45 robolog('Search query didn''t match anything.', 'ERR');
47 fullNameParsed = regexprep(fullName, '([A-Z_])', '_$1');
48 fullNameParsed = lower(fullNameParsed);
49 if exist(fullName, 'class') == 8
50 url = sprintf('%s/doc/user manual/html/class%s.html', roboRoot, fullNameParsed);
52 url = sprintf('%s/doc/user manual/html/%s_8m.html', roboRoot, fullNameParsed);
55 url = sprintf('%s/doc/user manual/html/index.html', roboRoot);
Superclass: basic building block to hold functions.
function robolog(in msg, in varargin)
This function allows the user to print log messages in a standard way.
function robochameleon(in varargin)
Add robochameleon related directories to the MATLAB path.
function robohelp(in varargin)
Open the robochameleon help main page or a class/function documentation in the browser.