5 'SStackElem must be given');
7 mxberry.
core.checkvar(SStackElem,
'isstruct(x)&&numel(x)==1',...
9 mxberry.
core.checkvar(SStackElem,
'all(isfield(x,{''file'',''name''}))',...
11 [pathStr,fileName]=fileparts(SStackElem.file);
12 if isempty(strfind(pathStr,[
filesep '+']))&&isempty(strfind(pathStr,[
filesep '@']))
17 pathStr=strrep(pathStr,[
filesep '+'],
'.');
18 indClass=strfind(pathStr,[
filesep '@']);
19 isClass=~isempty(indClass);
21 pathStr(indClass)=
'.';
22 pathStr(indClass+1)=[];
24 curInd=find(pathStr==
filesep,1,
'last');
26 pathStr=pathStr(curInd+1:end);
28 curInd=find(pathStr==
'.',1,
'first');
32 pathStr=pathStr(curInd+1:end);
33 isPath=~isempty(pathStr);
36 methodName=SStackElem.name;
37 curInd=find(methodName==
'.',1,
'last');
39 methodName=methodName(curInd+1:end);
42 pathStr=[pathStr
'.' fileName];
54 curInd=find(methodName==
'/'|methodName==
'\',1,
'first');
56 mainMethodName=methodName;
58 mainMethodName=methodName(1:curInd-1);
60 curInd=find(className==
'.',1,
'last');
62 mainClassName=className;
64 mainClassName=className(curInd+1:end);
66 if ~(isequal(fileName,mainMethodName)||(isClass&&isequal(fileName,mainClassName)))
67 methodName=[fileName
'/' methodName];
70 methodName=[pathStr
'.' methodName];
function parsestackelem(in SStackElem)
PARSESTACKELEM parses structure for given element of stack and returns the corresponding function/scr...