Home > classes > @provenance > string.m

string

PURPOSE ^

STRING writes a command string that can be used to recreate the input provenance object.

SYNOPSIS ^

function cmd = string(varargin)

DESCRIPTION ^

 STRING writes a command string that can be used to recreate the input provenance object.
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

 DESCRIPTION: STRING writes a command string that can be used to recreate the
              input provenance object.

 CALL:        cmd = string(obj)

 INPUT:       obj - provenance object

 OUTPUT:      cmd - command string to create the input object

 M-FILE INFO: Get information about this methods by calling
              >> provenance.getInfo('string')

              Get information about a specified set-plist by calling:
              >> provenance.getInfo('string', 'set')

 VERSION:     $Id: string.m,v 1.4 2008/09/04 15:29:31 ingo Exp $

 HISTORY:     15-02-2008 Diepholz
                 Creation

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

CROSS-REFERENCE INFORMATION ^

This function calls: This function is called by:

SUBFUNCTIONS ^

SOURCE CODE ^

0001 % STRING writes a command string that can be used to recreate the input provenance object.
0002 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
0003 %
0004 % DESCRIPTION: STRING writes a command string that can be used to recreate the
0005 %              input provenance object.
0006 %
0007 % CALL:        cmd = string(obj)
0008 %
0009 % INPUT:       obj - provenance object
0010 %
0011 % OUTPUT:      cmd - command string to create the input object
0012 %
0013 % M-FILE INFO: Get information about this methods by calling
0014 %              >> provenance.getInfo('string')
0015 %
0016 %              Get information about a specified set-plist by calling:
0017 %              >> provenance.getInfo('string', 'set')
0018 %
0019 % VERSION:     $Id: string.m,v 1.4 2008/09/04 15:29:31 ingo Exp $
0020 %
0021 % HISTORY:     15-02-2008 Diepholz
0022 %                 Creation
0023 %
0024 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
0025 
0026 function cmd = string(varargin)
0027 
0028   % Check if this is a call for parameters
0029   if utils.helper.isinfocall(varargin{:})
0030     cmd = getInfo(varargin{3});
0031     return
0032   end
0033 
0034   objs = utils.helper.collect_objects(varargin(:), 'provenance');
0035 
0036   %%% Wrap the command only in bracket if the there are more than one object
0037   if length(objs) > 1
0038     cmd = '[';
0039   else
0040     cmd = '';
0041   end
0042 
0043   for j=1:length(objs)
0044     creator = objs(j).creator;
0045     creator = strcat('Recreated from: ', creator);
0046     cmd = [cmd 'provenance(''' creator ''') '];
0047   end
0048 
0049   if length(objs) > 1
0050     cmd = [cmd ']'];
0051   end
0052 end
0053 
0054 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
0055 %                               Local Functions                               %
0056 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
0057 
0058 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
0059 %
0060 % FUNCTION:    getInfo
0061 %
0062 % DESCRIPTION: Get Info Object
0063 %
0064 % HISTORY:     11-07-07 M Hewitson
0065 %                Creation.
0066 %
0067 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
0068 
0069 function ii = getInfo(varargin)
0070   if nargin == 1 && strcmpi(varargin{1}, 'None')
0071     sets = {};
0072     pl   = [];
0073   else
0074     sets = {'Default'};
0075     pl   = getDefaultPlist;
0076   end
0077   % Build info object
0078   ii = minfo(mfilename, 'provenance', '', utils.const.categories.output, '$Id: string.m,v 1.4 2008/09/04 15:29:31 ingo Exp $', sets, pl);
0079 end
0080 
0081 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
0082 %
0083 % FUNCTION:    getDefaultPlist
0084 %
0085 % DESCRIPTION: Get Default Plist
0086 %
0087 % HISTORY:     11-07-07 M Hewitson
0088 %                Creation.
0089 %
0090 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
0091 
0092 function plo = getDefaultPlist()
0093   plo = plist();
0094 end
0095

Generated on Mon 08-Sep-2008 13:18:47 by m2html © 2003