tor-browser

The Tor Browser
git clone https://git.dasho.dev/tor-browser.git
Log | Files | Refs | README | LICENSE

ICU4XDangiCalendar.cpp (1929B)


      1 /* This Source Code Form is subject to the terms of the Mozilla Public
      2 * License, v. 2.0. If a copy of the MPL was not distributed with this
      3 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
      4 
      5 #include "mozilla/intl/calendar/ICU4XDangiCalendar.h"
      6 
      7 namespace mozilla::intl::calendar {
      8 
      9 ICU4XDangiCalendar::ICU4XDangiCalendar(const icu::Locale& locale,
     10                                       UErrorCode& success)
     11    : ICU4XChineseBasedCalendar(icu4x::capi::CalendarKind_Dangi, locale,
     12                                success) {}
     13 
     14 ICU4XDangiCalendar::ICU4XDangiCalendar(const icu::TimeZone& timeZone,
     15                                       const icu::Locale& locale,
     16                                       UErrorCode& success)
     17    : ICU4XChineseBasedCalendar(icu4x::capi::CalendarKind_Dangi, timeZone,
     18                                locale, success) {}
     19 
     20 ICU4XDangiCalendar::ICU4XDangiCalendar(const ICU4XDangiCalendar& other)
     21    : ICU4XChineseBasedCalendar(other) {}
     22 
     23 ICU4XDangiCalendar::~ICU4XDangiCalendar() = default;
     24 
     25 ICU4XDangiCalendar* ICU4XDangiCalendar::clone() const {
     26  return new ICU4XDangiCalendar(*this);
     27 }
     28 
     29 const char* ICU4XDangiCalendar::getType() const { return "dangi"; }
     30 
     31 ////////////////////////////////////////////
     32 // ICU4XCalendar implementation overrides //
     33 ////////////////////////////////////////////
     34 
     35 std::string_view ICU4XDangiCalendar::eraName(int32_t extendedYear) const {
     36  return "";
     37 }
     38 
     39 ////////////////////////////////////////////
     40 // icu::Calendar implementation overrides //
     41 ////////////////////////////////////////////
     42 
     43 UDate ICU4XDangiCalendar::defaultCenturyStart() const {
     44  return defaultCentury_.start();
     45 }
     46 
     47 int32_t ICU4XDangiCalendar::defaultCenturyStartYear() const {
     48  return defaultCentury_.startYear();
     49 }
     50 
     51 UBool ICU4XDangiCalendar::haveDefaultCentury() const { return true; }
     52 
     53 UOBJECT_DEFINE_RTTI_IMPLEMENTATION(ICU4XDangiCalendar)
     54 
     55 }  // namespace mozilla::intl::calendar