Home > classes > @time > string.m

string

PURPOSE ^

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

SYNOPSIS ^

function cmd = string(tt, varargin)

DESCRIPTION ^

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

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

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

 CALL:        cmd = string(pole);

 VERSION:     $Id: string.html,v 1.12 2008/03/31 10:27:40 hewitson Exp $

 HISTORY:     07-08-2007 Diepholz
                 Creation

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

CROSS-REFERENCE INFORMATION ^

This function calls: This function is called by:

SOURCE CODE ^

0001 function cmd = string(tt, varargin)
0002 % STRING writes a command string that can be used to recreate the input time object.
0003 %
0004 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
0005 %
0006 % DESCRIPTION: STRING writes a command string that can be used to recreate the
0007 %              input time object.
0008 %
0009 % CALL:        cmd = string(pole);
0010 %
0011 % VERSION:     $Id: string.html,v 1.12 2008/03/31 10:27:40 hewitson Exp $
0012 %
0013 % HISTORY:     07-08-2007 Diepholz
0014 %                 Creation
0015 %
0016 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
0017 
0018 VERSION = '$Id: string.html,v 1.12 2008/03/31 10:27:40 hewitson Exp $';
0019 CATEGORY = 'Helper';
0020 
0021 % Check if this is a call for parameters or for the cvs-version number
0022 if nargin == 2
0023   if isa(tt, 'time') && ischar(varargin{1})
0024     in = char(varargin{1});
0025     if strcmp(in, 'Params')
0026       cmd = plist();
0027       return
0028     elseif strcmp(in, 'Version')
0029       cmd = VERSION;
0030       return
0031     elseif strcmp(in, 'Category')
0032       cmd = CATEGORY;
0033       return
0034     end
0035   end
0036 end
0037 
0038 cmd = '[';
0039 for jj=1:length(tt)
0040 
0041   if isempty(tt.plist)
0042     pl = plist();
0043     pl = append(pl, 'timeformat',      char(tt(jj).timeformat));
0044     pl = append(pl, 'timezone',        char(tt(jj).timezone.getID));
0045     pl = append(pl, 'utc_epoch_milli', tt(jj).utc_epoch_milli);
0046   else
0047     pl = tt.plist;
0048   end
0049 
0050   cmd = [cmd ' time(' string(pl) ')'];
0051 
0052 end
0053 cmd = [cmd ']'];
0054 
0055 % END

Generated on Mon 31-Mar-2008 12:20:24 by m2html © 2003