11cb0ef41Sopenharmony_ci// Copyright 2018 the V8 project authors. All rights reserved. 21cb0ef41Sopenharmony_ci// Use of this source code is governed by a BSD-style license that can be 31cb0ef41Sopenharmony_ci// found in the LICENSE file. 41cb0ef41Sopenharmony_ci 51cb0ef41Sopenharmony_ci#ifndef V8_INTL_SUPPORT 61cb0ef41Sopenharmony_ci#error Internationalization is expected to be enabled. 71cb0ef41Sopenharmony_ci#endif // V8_INTL_SUPPORT 81cb0ef41Sopenharmony_ci 91cb0ef41Sopenharmony_ci#ifndef V8_OBJECTS_JS_DATE_TIME_FORMAT_INL_H_ 101cb0ef41Sopenharmony_ci#define V8_OBJECTS_JS_DATE_TIME_FORMAT_INL_H_ 111cb0ef41Sopenharmony_ci 121cb0ef41Sopenharmony_ci#include "src/objects/js-date-time-format.h" 131cb0ef41Sopenharmony_ci#include "src/objects/objects-inl.h" 141cb0ef41Sopenharmony_ci 151cb0ef41Sopenharmony_ci// Has to be the last include (doesn't have include guards): 161cb0ef41Sopenharmony_ci#include "src/objects/object-macros.h" 171cb0ef41Sopenharmony_ci 181cb0ef41Sopenharmony_cinamespace v8 { 191cb0ef41Sopenharmony_cinamespace internal { 201cb0ef41Sopenharmony_ci 211cb0ef41Sopenharmony_ci#include "torque-generated/src/objects/js-date-time-format-tq-inl.inc" 221cb0ef41Sopenharmony_ci 231cb0ef41Sopenharmony_ciTQ_OBJECT_CONSTRUCTORS_IMPL(JSDateTimeFormat) 241cb0ef41Sopenharmony_ci 251cb0ef41Sopenharmony_ciACCESSORS(JSDateTimeFormat, icu_locale, Managed<icu::Locale>, kIcuLocaleOffset) 261cb0ef41Sopenharmony_ciACCESSORS(JSDateTimeFormat, icu_simple_date_format, 271cb0ef41Sopenharmony_ci Managed<icu::SimpleDateFormat>, kIcuSimpleDateFormatOffset) 281cb0ef41Sopenharmony_ciACCESSORS(JSDateTimeFormat, icu_date_interval_format, 291cb0ef41Sopenharmony_ci Managed<icu::DateIntervalFormat>, kIcuDateIntervalFormatOffset) 301cb0ef41Sopenharmony_ci 311cb0ef41Sopenharmony_ciBOOL_ACCESSORS(JSDateTimeFormat, flags, alt_calendar, AltCalendarBit::kShift) 321cb0ef41Sopenharmony_ci 331cb0ef41Sopenharmony_ciinline void JSDateTimeFormat::set_hour_cycle(HourCycle hour_cycle) { 341cb0ef41Sopenharmony_ci int hints = flags(); 351cb0ef41Sopenharmony_ci hints = HourCycleBits::update(hints, hour_cycle); 361cb0ef41Sopenharmony_ci set_flags(hints); 371cb0ef41Sopenharmony_ci} 381cb0ef41Sopenharmony_ci 391cb0ef41Sopenharmony_ciinline JSDateTimeFormat::HourCycle JSDateTimeFormat::hour_cycle() const { 401cb0ef41Sopenharmony_ci return HourCycleBits::decode(flags()); 411cb0ef41Sopenharmony_ci} 421cb0ef41Sopenharmony_ci 431cb0ef41Sopenharmony_ciinline void JSDateTimeFormat::set_date_style( 441cb0ef41Sopenharmony_ci JSDateTimeFormat::DateTimeStyle date_style) { 451cb0ef41Sopenharmony_ci int hints = flags(); 461cb0ef41Sopenharmony_ci hints = DateStyleBits::update(hints, date_style); 471cb0ef41Sopenharmony_ci set_flags(hints); 481cb0ef41Sopenharmony_ci} 491cb0ef41Sopenharmony_ci 501cb0ef41Sopenharmony_ciinline JSDateTimeFormat::DateTimeStyle JSDateTimeFormat::date_style() const { 511cb0ef41Sopenharmony_ci return DateStyleBits::decode(flags()); 521cb0ef41Sopenharmony_ci} 531cb0ef41Sopenharmony_ci 541cb0ef41Sopenharmony_ciinline void JSDateTimeFormat::set_time_style( 551cb0ef41Sopenharmony_ci JSDateTimeFormat::DateTimeStyle time_style) { 561cb0ef41Sopenharmony_ci int hints = flags(); 571cb0ef41Sopenharmony_ci hints = TimeStyleBits::update(hints, time_style); 581cb0ef41Sopenharmony_ci set_flags(hints); 591cb0ef41Sopenharmony_ci} 601cb0ef41Sopenharmony_ci 611cb0ef41Sopenharmony_ciinline JSDateTimeFormat::DateTimeStyle JSDateTimeFormat::time_style() const { 621cb0ef41Sopenharmony_ci return TimeStyleBits::decode(flags()); 631cb0ef41Sopenharmony_ci} 641cb0ef41Sopenharmony_ci 651cb0ef41Sopenharmony_ci} // namespace internal 661cb0ef41Sopenharmony_ci} // namespace v8 671cb0ef41Sopenharmony_ci 681cb0ef41Sopenharmony_ci#include "src/objects/object-macros-undef.h" 691cb0ef41Sopenharmony_ci 701cb0ef41Sopenharmony_ci#endif // V8_OBJECTS_JS_DATE_TIME_FORMAT_INL_H_ 71