comparison m-toolbox/classes/+utils/@helper/getHelpPath.m @ 0:f0afece42f48

Import.
author Daniele Nicolodi <nicolodi@science.unitn.it>
date Wed, 23 Nov 2011 19:22:13 +0100
parents
children
comparison
equal deleted inserted replaced
-1:000000000000 0:f0afece42f48
1 % GETHELPPATH return the full path of the LTPDA toolbox help
2 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
3 %
4 % DESCRIPTION: GETHELPPATH return the full path of the LTPDA toolbox help.
5 %
6 % CALL: path = utils.helper.getHelpPath()
7 %
8 % EXCEPTION: Throws an error if this method doesn't find the LTPDA
9 % toolbox.
10 %
11 % VERSION: $Id: getHelpPath.m,v 1.2 2010/12/17 14:23:22 hewitson Exp $
12 %
13 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
14
15 function helpLocation = getHelpPath()
16
17 root = getappdata(0, 'LTPDAROOT');
18 if ~isempty(root)
19 helpLocation = fullfile(root, 'ltpda', 'help');
20 return;
21 else
22 infoPath = which('info.xml');
23 infoLocation = fileparts(infoPath);
24
25 infoXML = xmlread('info.xml');
26 tbNameNode = infoXML.getElementsByTagName('name');
27 tbName = tbNameNode.item(0).getFirstChild.getData;
28 if strcmp(tbName, 'LTPDA')
29 helpLocationNodes = infoXML.getElementsByTagName('help_location');
30 helpLocation = char(helpLocationNodes.item(0).getFirstChild.getTextContent);
31 else % Otherwise error out
32 error('Can not find info.xml file for My Toolbox');
33 end
34
35 helpLocation = fullfile(infoLocation, helpLocation);
36 end
37 end