comparison src/DLD-FUNCTIONS/time.cc @ 10154:40dfc0c99116

DLD-FUNCTIONS/*.cc: untabify
author John W. Eaton <jwe@octave.org>
date Wed, 20 Jan 2010 17:33:41 -0500
parents 923c7cb7f13f
children d0ce5e973937
comparison
equal deleted inserted replaced
10153:2c28f9d0360f 10154:40dfc0c99116
134 if (args.length () == 1) 134 if (args.length () == 1)
135 { 135 {
136 double tmp = args(0).double_value (); 136 double tmp = args(0).double_value ();
137 137
138 if (! error_state) 138 if (! error_state)
139 retval = octave_value (mk_tm_map (octave_gmtime (tmp))); 139 retval = octave_value (mk_tm_map (octave_gmtime (tmp)));
140 } 140 }
141 else 141 else
142 print_usage (); 142 print_usage ();
143 143
144 return retval; 144 return retval;
198 if (args.length () == 1) 198 if (args.length () == 1)
199 { 199 {
200 double tmp = args(0).double_value (); 200 double tmp = args(0).double_value ();
201 201
202 if (! error_state) 202 if (! error_state)
203 retval = octave_value (mk_tm_map (octave_localtime (tmp))); 203 retval = octave_value (mk_tm_map (octave_localtime (tmp)));
204 } 204 }
205 else 205 else
206 print_usage (); 206 print_usage ();
207 207
208 return retval; 208 return retval;
250 if (args.length () == 1) 250 if (args.length () == 1)
251 { 251 {
252 Octave_map map = args(0).map_value (); 252 Octave_map map = args(0).map_value ();
253 253
254 if (! error_state) 254 if (! error_state)
255 { 255 {
256 octave_base_tm tm = extract_tm (map); 256 octave_base_tm tm = extract_tm (map);
257 257
258 if (! error_state) 258 if (! error_state)
259 retval = octave_time (tm); 259 retval = octave_time (tm);
260 else 260 else
261 error ("mktime: invalid TMSTRUCT argument"); 261 error ("mktime: invalid TMSTRUCT argument");
262 } 262 }
263 else 263 else
264 error ("mktime: expecting structure argument"); 264 error ("mktime: expecting structure argument");
265 } 265 }
266 else 266 else
267 print_usage (); 267 print_usage ();
268 268
269 return retval; 269 return retval;
439 if (args.length () == 2) 439 if (args.length () == 2)
440 { 440 {
441 std::string fmt = args(0).string_value (); 441 std::string fmt = args(0).string_value ();
442 442
443 if (! error_state) 443 if (! error_state)
444 { 444 {
445 Octave_map map = args(1).map_value (); 445 Octave_map map = args(1).map_value ();
446 446
447 if (! error_state) 447 if (! error_state)
448 { 448 {
449 octave_base_tm tm = extract_tm (map); 449 octave_base_tm tm = extract_tm (map);
450 450
451 if (! error_state) 451 if (! error_state)
452 retval = tm.strftime (fmt); 452 retval = tm.strftime (fmt);
453 else 453 else
454 error ("strftime: invalid TMSTRUCT argument"); 454 error ("strftime: invalid TMSTRUCT argument");
455 } 455 }
456 else 456 else
457 error ("strftime: expecting structure as second argument"); 457 error ("strftime: expecting structure as second argument");
458 } 458 }
459 else 459 else
460 error ("strftime: expecting format string as first argument"); 460 error ("strftime: expecting format string as first argument");
461 } 461 }
462 else 462 else
463 print_usage (); 463 print_usage ();
464 464
465 return retval; 465 return retval;
496 if (args.length () == 2) 496 if (args.length () == 2)
497 { 497 {
498 std::string str = args(0).string_value (); 498 std::string str = args(0).string_value ();
499 499
500 if (! error_state) 500 if (! error_state)
501 { 501 {
502 std::string fmt = args(1).string_value (); 502 std::string fmt = args(1).string_value ();
503 503
504 if (! error_state) 504 if (! error_state)
505 { 505 {
506 octave_strptime t (str, fmt); 506 octave_strptime t (str, fmt);
507 507
508 retval(1) = t.characters_converted (); 508 retval(1) = t.characters_converted ();
509 retval(0) = octave_value (mk_tm_map (t)); 509 retval(0) = octave_value (mk_tm_map (t));
510 } 510 }
511 else 511 else
512 error ("strptime: expecting format string as second argument"); 512 error ("strptime: expecting format string as second argument");
513 } 513 }
514 else 514 else
515 error ("strptime: expecting string as first argument"); 515 error ("strptime: expecting string as first argument");
516 } 516 }
517 else 517 else
518 print_usage (); 518 print_usage ();
519 519
520 return retval; 520 return retval;