| 1 |
|
| MODE: INLINE |
| 2 |
|
| |
| 3 |
|
| static inline Hash export_transition (const Timezone::Transition& trans, bool is_past) { |
| 4 |
|
| auto hash = Hash::create(); |
| 5 |
|
| hash.store("offset", Simple(trans.offset)); |
| 6 |
|
| hash.store("abbrev", Simple(trans.abbrev)); |
| 7 |
|
| if (!is_past) { |
| 8 |
|
| hash.store("start", Simple(trans.start)); |
| 9 |
|
| hash.store("isdst", Simple(trans.isdst)); |
| 10 |
|
| hash.store("gmt_offset", Simple(trans.gmt_offset)); |
| 11 |
|
| hash.store("leap_corr", Simple(trans.leap_corr)); |
| 12 |
|
| hash.store("leap_delta", Simple(trans.leap_delta)); |
| 13 |
|
| } |
| 14 |
|
| return hash; |
| 15 |
|
| } |
| 16 |
|
| |
| 17 |
|
| MODULE = Date PACKAGE = Date::Timezone |
| 18 |
|
| PROTOTYPES: DISABLE |
| 19 |
|
| |
| 20 |
|
| string Timezone::name () : const { |
| 21 |
14 |
▶ | RETVAL = THIS->name; |
Branch: 1 branch
| Branch | True | False | Total |
| RETVAL = THIS->name; |
14 |
0 |
14 |
|
| 22 |
|
| } |
| 23 |
|
| |
| 24 |
|
| bool Timezone::is_local () : const { |
| 25 |
12 |
▶ | RETVAL = THIS->is_local; |
Branch: 1 branch
| Branch | True | False | Total |
| RETVAL = THIS->is_local; |
12 |
0 |
12 |
|
| 26 |
|
| } |
| 27 |
|
| |
| 28 |
|
| Hash Timezone::export () : const { |
| 29 |
2 |
▶ | RETVAL = Hash::create(); |
Branch: 1 branch
| Branch | True | False | Total |
| RETVAL = Hash::create(); |
2 |
0 |
2 |
|
| 30 |
|
| |
| 31 |
2 |
▶ | RETVAL.store("name", Simple(string_view(THIS->name.data(), THIS->name.length()))); |
Branch: 2 branches
| Branch | True | False | Total |
| RETVAL.store("name", Simple(string_view(THIS->name.data(), THIS->name.length()))); |
2 |
0 |
2 |
| RETVAL.store("name", Simple(string_view(THIS->name.data(), THIS->name.length()))); |
2 |
0 |
2 |
|
| 32 |
2 |
▶ | RETVAL.store("is_local", Simple(THIS->is_local ? 1 : 0)); |
Branch: 3 branches
| Branch | True | False | Total |
| RETVAL.store("is_local", Simple(THIS->is_local ? 1 : 0)); |
2 |
0 |
2 |
| RETVAL.store("is_local", Simple(THIS->is_local ? 1 : 0)); |
2 |
0 |
2 |
| RETVAL.store("is_local", Simple(THIS->is_local ? 1 : 0)); |
2 |
0 |
2 |
|
| 33 |
|
| |
| 34 |
2 |
▶ | auto future = Hash::create(); |
Branch: 1 branch
| Branch | True | False | Total |
| auto future = Hash::create(); |
2 |
0 |
2 |
|
| 35 |
2 |
▶ | future.store("hasdst", Simple(THIS->future.hasdst ? 1 : 0)); |
Branch: 3 branches
| Branch | True | False | Total |
| future.store("hasdst", Simple(THIS->future.hasdst ? 1 : 0)); |
0 |
2 |
2 |
| future.store("hasdst", Simple(THIS->future.hasdst ? 1 : 0)); |
2 |
0 |
2 |
| future.store("hasdst", Simple(THIS->future.hasdst ? 1 : 0)); |
2 |
0 |
2 |
|
| 36 |
|
| |
| 37 |
2 |
▶ | auto outer = Hash::create(); |
Branch: 1 branch
| Branch | True | False | Total |
| auto outer = Hash::create(); |
2 |
0 |
2 |
|
| 38 |
2 |
▶ | outer.store("abbrev", Simple(string_view(THIS->future.outer.abbrev, strlen(THIS->future.outer.abbrev)))); |
Branch: 2 branches
| Branch | True | False | Total |
| outer.store("abbrev", Simple(string_view(THIS->future.outer.abbrev, strlen(THIS->future.outer.abbrev)))); |
2 |
0 |
2 |
| outer.store("abbrev", Simple(string_view(THIS->future.outer.abbrev, strlen(THIS->future.outer.abbrev)))); |
2 |
0 |
2 |
|
| 39 |
2 |
▶ | outer.store("offset", Simple(THIS->future.outer.offset)); |
Branch: 2 branches
| Branch | True | False | Total |
| outer.store("offset", Simple(THIS->future.outer.offset)); |
2 |
0 |
2 |
| outer.store("offset", Simple(THIS->future.outer.offset)); |
2 |
0 |
2 |
|
| 40 |
2 |
▶ | outer.store("gmt_offset", Simple(THIS->future.outer.gmt_offset)); |
Branch: 2 branches
| Branch | True | False | Total |
| outer.store("gmt_offset", Simple(THIS->future.outer.gmt_offset)); |
2 |
0 |
2 |
| outer.store("gmt_offset", Simple(THIS->future.outer.gmt_offset)); |
2 |
0 |
2 |
|
| 41 |
2 |
▶ | outer.store("isdst", Simple(THIS->future.outer.isdst)); |
Branch: 2 branches
| Branch | True | False | Total |
| outer.store("isdst", Simple(THIS->future.outer.isdst)); |
2 |
0 |
2 |
| outer.store("isdst", Simple(THIS->future.outer.isdst)); |
2 |
0 |
2 |
|
| 42 |
2 |
▶ | future.store("outer", Ref::create(outer)); |
Branch: 2 branches
| Branch | True | False | Total |
| future.store("outer", Ref::create(outer)); |
2 |
0 |
2 |
| future.store("outer", Ref::create(outer)); |
2 |
0 |
2 |
|
| 43 |
|
| |
| 44 |
2 |
▶ | if (THIS->future.hasdst) { |
Branch: 1 branch
| Branch | True | False | Total |
| if (THIS->future.hasdst) { |
0 |
2 |
2 |
|
| 45 |
0 |
▶ | auto outer_end = Hash::create(); |
Branch: 1 branch
| Branch | True | False | Total |
| auto outer_end = Hash::create(); |
0 |
0 |
0 |
|
| 46 |
0 |
▶ | outer_end.store("mon", Simple(THIS->future.outer.end.mon)); |
Branch: 2 branches
| Branch | True | False | Total |
| outer_end.store("mon", Simple(THIS->future.outer.end.mon)); |
0 |
0 |
0 |
| outer_end.store("mon", Simple(THIS->future.outer.end.mon)); |
0 |
0 |
0 |
|
| 47 |
0 |
▶ | outer_end.store("week", Simple(THIS->future.outer.end.yday)); |
Branch: 2 branches
| Branch | True | False | Total |
| outer_end.store("week", Simple(THIS->future.outer.end.yday)); |
0 |
0 |
0 |
| outer_end.store("week", Simple(THIS->future.outer.end.yday)); |
0 |
0 |
0 |
|
| 48 |
0 |
▶ | outer_end.store("day", Simple(THIS->future.outer.end.wday)); |
Branch: 2 branches
| Branch | True | False | Total |
| outer_end.store("day", Simple(THIS->future.outer.end.wday)); |
0 |
0 |
0 |
| outer_end.store("day", Simple(THIS->future.outer.end.wday)); |
0 |
0 |
0 |
|
| 49 |
0 |
▶ | outer_end.store("hour", Simple(THIS->future.outer.end.hour)); |
Branch: 2 branches
| Branch | True | False | Total |
| outer_end.store("hour", Simple(THIS->future.outer.end.hour)); |
0 |
0 |
0 |
| outer_end.store("hour", Simple(THIS->future.outer.end.hour)); |
0 |
0 |
0 |
|
| 50 |
0 |
▶ | outer_end.store("min", Simple(THIS->future.outer.end.min)); |
Branch: 2 branches
| Branch | True | False | Total |
| outer_end.store("min", Simple(THIS->future.outer.end.min)); |
0 |
0 |
0 |
| outer_end.store("min", Simple(THIS->future.outer.end.min)); |
0 |
0 |
0 |
|
| 51 |
0 |
▶ | outer_end.store("sec", Simple(THIS->future.outer.end.sec)); |
Branch: 2 branches
| Branch | True | False | Total |
| outer_end.store("sec", Simple(THIS->future.outer.end.sec)); |
0 |
0 |
0 |
| outer_end.store("sec", Simple(THIS->future.outer.end.sec)); |
0 |
0 |
0 |
|
| 52 |
0 |
▶ | outer.store("end", Ref::create(outer_end)); |
Branch: 2 branches
| Branch | True | False | Total |
| outer.store("end", Ref::create(outer_end)); |
0 |
0 |
0 |
| outer.store("end", Ref::create(outer_end)); |
0 |
0 |
0 |
|
| 53 |
|
| |
| 54 |
0 |
▶ | auto inner = Hash::create(); |
Branch: 1 branch
| Branch | True | False | Total |
| auto inner = Hash::create(); |
0 |
0 |
0 |
|
| 55 |
0 |
▶ | inner.store("abbrev", Simple(string_view(THIS->future.inner.abbrev, strlen(THIS->future.inner.abbrev)))); |
Branch: 2 branches
| Branch | True | False | Total |
| inner.store("abbrev", Simple(string_view(THIS->future.inner.abbrev, strlen(THIS->future.inner.abbrev)))); |
0 |
0 |
0 |
| inner.store("abbrev", Simple(string_view(THIS->future.inner.abbrev, strlen(THIS->future.inner.abbrev)))); |
0 |
0 |
0 |
|
| 56 |
0 |
▶ | inner.store("offset", Simple(THIS->future.inner.offset)); |
Branch: 2 branches
| Branch | True | False | Total |
| inner.store("offset", Simple(THIS->future.inner.offset)); |
0 |
0 |
0 |
| inner.store("offset", Simple(THIS->future.inner.offset)); |
0 |
0 |
0 |
|
| 57 |
0 |
▶ | inner.store("gmt_offset", Simple(THIS->future.inner.gmt_offset)); |
Branch: 2 branches
| Branch | True | False | Total |
| inner.store("gmt_offset", Simple(THIS->future.inner.gmt_offset)); |
0 |
0 |
0 |
| inner.store("gmt_offset", Simple(THIS->future.inner.gmt_offset)); |
0 |
0 |
0 |
|
| 58 |
0 |
▶ | inner.store("isdst", Simple(THIS->future.inner.isdst)); |
Branch: 2 branches
| Branch | True | False | Total |
| inner.store("isdst", Simple(THIS->future.inner.isdst)); |
0 |
0 |
0 |
| inner.store("isdst", Simple(THIS->future.inner.isdst)); |
0 |
0 |
0 |
|
| 59 |
|
| |
| 60 |
0 |
▶ | auto inner_end = Hash::create(); |
Branch: 1 branch
| Branch | True | False | Total |
| auto inner_end = Hash::create(); |
0 |
0 |
0 |
|
| 61 |
0 |
▶ | inner_end.store("mon", Simple(THIS->future.inner.end.mon)); |
Branch: 2 branches
| Branch | True | False | Total |
| inner_end.store("mon", Simple(THIS->future.inner.end.mon)); |
0 |
0 |
0 |
| inner_end.store("mon", Simple(THIS->future.inner.end.mon)); |
0 |
0 |
0 |
|
| 62 |
0 |
▶ | inner_end.store("week", Simple(THIS->future.inner.end.yday)); |
Branch: 2 branches
| Branch | True | False | Total |
| inner_end.store("week", Simple(THIS->future.inner.end.yday)); |
0 |
0 |
0 |
| inner_end.store("week", Simple(THIS->future.inner.end.yday)); |
0 |
0 |
0 |
|
| 63 |
0 |
▶ | inner_end.store("day", Simple(THIS->future.inner.end.wday)); |
Branch: 2 branches
| Branch | True | False | Total |
| inner_end.store("day", Simple(THIS->future.inner.end.wday)); |
0 |
0 |
0 |
| inner_end.store("day", Simple(THIS->future.inner.end.wday)); |
0 |
0 |
0 |
|
| 64 |
0 |
▶ | inner_end.store("hour", Simple(THIS->future.inner.end.hour)); |
Branch: 2 branches
| Branch | True | False | Total |
| inner_end.store("hour", Simple(THIS->future.inner.end.hour)); |
0 |
0 |
0 |
| inner_end.store("hour", Simple(THIS->future.inner.end.hour)); |
0 |
0 |
0 |
|
| 65 |
0 |
▶ | inner_end.store("min", Simple(THIS->future.inner.end.min)); |
Branch: 2 branches
| Branch | True | False | Total |
| inner_end.store("min", Simple(THIS->future.inner.end.min)); |
0 |
0 |
0 |
| inner_end.store("min", Simple(THIS->future.inner.end.min)); |
0 |
0 |
0 |
|
| 66 |
0 |
▶ | inner_end.store("sec", Simple(THIS->future.inner.end.sec)); |
Branch: 2 branches
| Branch | True | False | Total |
| inner_end.store("sec", Simple(THIS->future.inner.end.sec)); |
0 |
0 |
0 |
| inner_end.store("sec", Simple(THIS->future.inner.end.sec)); |
0 |
0 |
0 |
|
| 67 |
0 |
▶ | inner.store("end", Ref::create(inner_end)); |
Branch: 2 branches
| Branch | True | False | Total |
| inner.store("end", Ref::create(inner_end)); |
0 |
0 |
0 |
| inner.store("end", Ref::create(inner_end)); |
0 |
0 |
0 |
|
| 68 |
|
| |
| 69 |
0 |
▶ | future.store("inner", Ref::create(inner)); |
Branch: 2 branches
| Branch | True | False | Total |
| future.store("inner", Ref::create(inner)); |
0 |
0 |
0 |
| future.store("inner", Ref::create(inner)); |
0 |
0 |
0 |
|
| 70 |
0 |
| } |
| 71 |
2 |
▶ | RETVAL.store("future", Ref::create(future)); |
Branch: 2 branches
| Branch | True | False | Total |
| RETVAL.store("future", Ref::create(future)); |
2 |
0 |
2 |
| RETVAL.store("future", Ref::create(future)); |
2 |
0 |
2 |
|
| 72 |
|
| |
| 73 |
2 |
▶ | auto trans = Array::create(); |
Branch: 1 branch
| Branch | True | False | Total |
| auto trans = Array::create(); |
2 |
0 |
2 |
|
| 74 |
162 |
▶ | for (uint32_t i = 0; i < THIS->trans_cnt; ++i) trans.push(Ref::create(export_transition(THIS->trans[i], false))); |
Branch: 4 branches
| Branch | True | False | Total |
| for (uint32_t i = 0; i < THIS->trans_cnt; ++i) trans.push(Ref::create(export_transition(THIS->trans[i], false))); |
160 |
0 |
160 |
| for (uint32_t i = 0; i < THIS->trans_cnt; ++i) trans.push(Ref::create(export_transition(THIS->trans[i], false))); |
160 |
0 |
160 |
| for (uint32_t i = 0; i < THIS->trans_cnt; ++i) trans.push(Ref::create(export_transition(THIS->trans[i], false))); |
160 |
0 |
160 |
| for (uint32_t i = 0; i < THIS->trans_cnt; ++i) trans.push(Ref::create(export_transition(THIS->trans[i], false))); |
160 |
2 |
162 |
|
| 75 |
2 |
▶ | RETVAL.store("transitions", Ref::create(trans)); |
Branch: 2 branches
| Branch | True | False | Total |
| RETVAL.store("transitions", Ref::create(trans)); |
2 |
0 |
2 |
| RETVAL.store("transitions", Ref::create(trans)); |
2 |
0 |
2 |
|
| 76 |
|
| |
| 77 |
2 |
▶ | RETVAL.store("past", Ref::create(export_transition(THIS->trans[0], true))); |
Branch: 3 branches
| Branch | True | False | Total |
| RETVAL.store("past", Ref::create(export_transition(THIS->trans[0], true))); |
2 |
0 |
2 |
| RETVAL.store("past", Ref::create(export_transition(THIS->trans[0], true))); |
2 |
0 |
2 |
| RETVAL.store("past", Ref::create(export_transition(THIS->trans[0], true))); |
2 |
0 |
2 |
|
| 78 |
|
| } |