tor-browser

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

ICU4XUniquePtr.h (1203B)


      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 #ifndef intl_components_calendar_ICU4XUniquePtr_h_
      5 #define intl_components_calendar_ICU4XUniquePtr_h_
      6 
      7 #include "mozilla/UniquePtr.h"
      8 
      9 #include "icu4x/Calendar.hpp"
     10 #include "icu4x/Date.hpp"
     11 #include "icu4x/IsoDate.hpp"
     12 
     13 namespace mozilla::intl::calendar {
     14 
     15 class ICU4XCalendarDeleter {
     16 public:
     17  void operator()(icu4x::capi::Calendar* ptr) {
     18    icu4x::capi::icu4x_Calendar_destroy_mv1(ptr);
     19  }
     20 };
     21 
     22 using UniqueICU4XCalendar =
     23    mozilla::UniquePtr<icu4x::capi::Calendar, ICU4XCalendarDeleter>;
     24 
     25 class ICU4XDateDeleter {
     26 public:
     27  void operator()(icu4x::capi::Date* ptr) {
     28    icu4x::capi::icu4x_Date_destroy_mv1(ptr);
     29  }
     30 };
     31 
     32 using UniqueICU4XDate = mozilla::UniquePtr<icu4x::capi::Date, ICU4XDateDeleter>;
     33 
     34 class ICU4XIsoDateDeleter {
     35 public:
     36  void operator()(icu4x::capi::IsoDate* ptr) {
     37    icu4x::capi::icu4x_IsoDate_destroy_mv1(ptr);
     38  }
     39 };
     40 
     41 using UniqueICU4XIsoDate =
     42    mozilla::UniquePtr<icu4x::capi::IsoDate, ICU4XIsoDateDeleter>;
     43 
     44 }  // namespace mozilla::intl::calendar
     45 
     46 #endif