зеркало из https://github.com/microsoft/STL.git
Add visualizer for `std::chrono::system_clock::time_point` (#5005)
This commit is contained in:
Родитель
e0ad9c3638
Коммит
a5d66bd1ba
|
@ -2312,4 +2312,57 @@ SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
|
|||
</Expand>
|
||||
</Type>
|
||||
|
||||
<Type Name="std::chrono::time_point<std::chrono::system_clock,std::chrono::duration<__int64,std::ratio<1,10000000> > >">
|
||||
<!--
|
||||
Same computation as in std::chrono::year_month_day::_Civil_from_days
|
||||
and https://howardhinnant.github.io/date_algorithms.html#civil_from_days.
|
||||
-->
|
||||
<Intrinsic Name="z" Expression="(_MyDur._MyRep / (24 * 60 * 60 * 10000000ull)) + 719468"/>
|
||||
<Intrinsic Name="era" Expression="(z() >= 0 ? z() : z() - 146096) / 146097"/>
|
||||
<Intrinsic Name="doe" Expression="(unsigned)(z() - era() * 146097)"/>
|
||||
<Intrinsic Name="yoe" Expression="(doe() - doe()/1460 + doe()/36524 - doe()/146096) / 365"/>
|
||||
<Intrinsic Name="doy" Expression="doe() - (365*yoe() + yoe()/4 - yoe()/100)"/>
|
||||
<Intrinsic Name="mp" Expression="(5*doy() + 2)/153"/>
|
||||
<Intrinsic Name="day" Expression="doy() - (153*mp()+2)/5 + 1"/>
|
||||
<Intrinsic Name="month" Expression="mp() < 10 ? mp()+3 : mp()-9"/>
|
||||
<Intrinsic Name="year" Expression="((long long)yoe()) + era() * 400 + (month() < 2)"/>
|
||||
|
||||
<DisplayString Condition="_MyDur._MyRep >= 0">
|
||||
{year(),d}-{month()/10,d}{month()%10,d}-{day()/10,d}{day()%10,d} {
|
||||
(_MyDur._MyRep % (24 * 60 * 60 * 10000000ull))/(10 * 60 * 60 * 10000000ull),d
|
||||
}{
|
||||
((_MyDur._MyRep % (24 * 60 * 60 * 10000000ull))/(60 * 60 * 10000000ull)) % 10,d
|
||||
}:{
|
||||
(_MyDur._MyRep % (60 * 60 * 10000000ull))/(10 * 60 * 10000000ull),d
|
||||
}{
|
||||
(_MyDur._MyRep % (10 * 60 * 10000000ull)) / (60 * 10000000ull),d
|
||||
}:{
|
||||
(_MyDur._MyRep % (60 * 10000000ull)) / (10 * 10000000ull),d
|
||||
}{
|
||||
(_MyDur._MyRep % (10 * 10000000ull)) / 10000000ull,d
|
||||
}.{
|
||||
(_MyDur._MyRep % 10000000) / 1000000,d
|
||||
}{
|
||||
(_MyDur._MyRep % 1000000) / 100000,d
|
||||
}{
|
||||
(_MyDur._MyRep % 100000) / 10000,d
|
||||
}{
|
||||
(_MyDur._MyRep % 10000) / 1000,d
|
||||
}{
|
||||
(_MyDur._MyRep % 1000) / 100,d
|
||||
}{
|
||||
(_MyDur._MyRep % 100) / 10,d
|
||||
}{
|
||||
_MyDur._MyRep % 10,d
|
||||
}
|
||||
</DisplayString>
|
||||
<Expand>
|
||||
<Item Name="[ns/100]">_MyDur._MyRep</Item>
|
||||
<Item Name="[us]">_MyDur._MyRep/10</Item>
|
||||
<Item Name="[ms]">_MyDur._MyRep/(10 * 1000)</Item>
|
||||
<Item Name="[s]">_MyDur._MyRep/(10 * 1000 * 1000)</Item>
|
||||
<Synthetic Name="[clock]"><DisplayString>UTC</DisplayString></Synthetic>
|
||||
</Expand>
|
||||
</Type>
|
||||
|
||||
</AutoVisualizer>
|
||||
|
|
Загрузка…
Ссылка в новой задаче