comparison m-toolbox/classes/+utils/@modules/moduleInfo.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 % MODULEINFO returns a structure containing information about the module.
2 %
3 % CALL
4 % info = utils.modules.moduleInfo(path_to_module)
5 %
6 % Information structure:
7 %
8 % info.name % module name
9 % info.version % module version
10 %
11 % M Hewitson 28-03-11
12 %
13 % $Id: moduleInfo.m,v 1.1 2011/03/28 11:27:13 hewitson Exp $
14 %
15
16 function info = moduleInfo(varargin)
17
18 if nargin ~= 1
19 help(mfilename);
20 error('Incorrect usage');
21 end
22
23 mpath = varargin{1};
24
25 xDoc = xmlread(mpath);
26 xRoot = xDoc.getDocumentElement;
27 info.name = char(xRoot.getAttribute('name'));
28 info.version = char(xRoot.getAttribute('version'));
29
30 end
31 % END