Changeset 1612 for XIOS/dev/dev_olga/src/interface/c/icduration.cpp
- Timestamp:
- 11/23/18 14:48:14 (6 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
XIOS/dev/dev_olga/src/interface/c/icduration.cpp
r1472 r1612 1 #include "xios.hpp" 2 1 3 #include "icutil.hpp" 2 4 #include "icdate.hpp" … … 6 8 { 7 9 void cxios_duration_convert_to_string(cxios_duration dur_c, char* str, int str_size) 10 TRY 8 11 { 9 12 xios::CDuration dur( dur_c.year, dur_c.month, dur_c.day, dur_c.hour, dur_c.minute, dur_c.second, dur_c.timestep ); … … 12 15 ERROR("void cxios_duration_convert_to_string(cxios_duration dur_c, char* str, int str_size)", << "Input string is too short"); 13 16 } 17 CATCH_DUMP_STACK 14 18 15 19 cxios_duration cxios_duration_convert_from_string(const char* str, int str_size) 20 TRY 16 21 { 17 22 std::string dur_str; … … 23 28 return { dur.year, dur.month, dur.day, dur.hour, dur.minute, dur.second, dur.timestep }; 24 29 } 30 CATCH_DUMP_STACK 25 31 26 32 cxios_duration cxios_duration_add(cxios_duration dur1_c, cxios_duration dur2_c) 33 TRY 27 34 { 28 35 xios::CDuration dur1( dur1_c.year, dur1_c.month, dur1_c.day, dur1_c.hour, dur1_c.minute, dur1_c.second, dur1_c.timestep ); … … 32 39 return { res.year, res.month, res.day, res.hour, res.minute, res.second, res.timestep }; 33 40 } 41 CATCH_DUMP_STACK 34 42 35 43 cxios_duration cxios_duration_sub(cxios_duration dur1_c, cxios_duration dur2_c) 44 TRY 36 45 { 37 46 xios::CDuration dur1( dur1_c.year, dur1_c.month, dur1_c.day, dur1_c.hour, dur1_c.minute, dur1_c.second, dur1_c.timestep ); … … 41 50 return { res.year, res.month, res.day, res.hour, res.minute, res.second, res.timestep }; 42 51 } 52 CATCH_DUMP_STACK 43 53 44 54 cxios_duration cxios_duration_mult(double val, cxios_duration dur_c) 55 TRY 45 56 { 46 57 xios::CDuration dur( dur_c.year, dur_c.month, dur_c.day, dur_c.hour, dur_c.minute, dur_c.second, dur_c.timestep ); … … 48 59 return { res.year, res.month, res.day, res.hour, res.minute, res.second, res.timestep }; 49 60 } 61 CATCH_DUMP_STACK 50 62 51 63 cxios_duration cxios_duration_neg(cxios_duration dur_c) 64 TRY 52 65 { 53 66 xios::CDuration dur( dur_c.year, dur_c.month, dur_c.day, dur_c.hour, dur_c.minute, dur_c.second, dur_c.timestep ); … … 55 68 return { res.year, res.month, res.day, res.hour, res.minute, res.second, res.timestep }; 56 69 } 70 CATCH_DUMP_STACK 57 71 58 72 bool cxios_duration_eq(cxios_duration dur1_c, cxios_duration dur2_c) 73 TRY 59 74 { 60 75 xios::CDuration dur1( dur1_c.year, dur1_c.month, dur1_c.day, dur1_c.hour, dur1_c.minute, dur1_c.second, dur1_c.timestep ); … … 62 77 return (dur1 == dur2); 63 78 } 79 CATCH_DUMP_STACK 64 80 65 81 bool cxios_duration_neq(cxios_duration dur1_c, cxios_duration dur2_c) 82 TRY 66 83 { 67 84 xios::CDuration dur1( dur1_c.year, dur1_c.month, dur1_c.day, dur1_c.hour, dur1_c.minute, dur1_c.second, dur1_c.timestep ); … … 69 86 return (dur1 != dur2); 70 87 } 88 CATCH_DUMP_STACK 71 89 }
Note: See TracChangeset
for help on using the changeset viewer.