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_RELATIVE_TIME_FORMAT_INL_H_
101cb0ef41Sopenharmony_ci#define V8_OBJECTS_JS_RELATIVE_TIME_FORMAT_INL_H_
111cb0ef41Sopenharmony_ci
121cb0ef41Sopenharmony_ci#include "src/objects/js-relative-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-relative-time-format-tq-inl.inc"
221cb0ef41Sopenharmony_ci
231cb0ef41Sopenharmony_ciTQ_OBJECT_CONSTRUCTORS_IMPL(JSRelativeTimeFormat)
241cb0ef41Sopenharmony_ci
251cb0ef41Sopenharmony_ci// Base relative time format accessors.
261cb0ef41Sopenharmony_ciACCESSORS(JSRelativeTimeFormat, icu_formatter,
271cb0ef41Sopenharmony_ci          Managed<icu::RelativeDateTimeFormatter>, kIcuFormatterOffset)
281cb0ef41Sopenharmony_ci
291cb0ef41Sopenharmony_ciinline void JSRelativeTimeFormat::set_numeric(Numeric numeric) {
301cb0ef41Sopenharmony_ci  DCHECK_GE(NumericBit::kMax, numeric);
311cb0ef41Sopenharmony_ci  int hints = flags();
321cb0ef41Sopenharmony_ci  hints = NumericBit::update(hints, numeric);
331cb0ef41Sopenharmony_ci  set_flags(hints);
341cb0ef41Sopenharmony_ci}
351cb0ef41Sopenharmony_ci
361cb0ef41Sopenharmony_ciinline JSRelativeTimeFormat::Numeric JSRelativeTimeFormat::numeric() const {
371cb0ef41Sopenharmony_ci  return NumericBit::decode(flags());
381cb0ef41Sopenharmony_ci}
391cb0ef41Sopenharmony_ci
401cb0ef41Sopenharmony_ci}  // namespace internal
411cb0ef41Sopenharmony_ci}  // namespace v8
421cb0ef41Sopenharmony_ci
431cb0ef41Sopenharmony_ci#include "src/objects/object-macros-undef.h"
441cb0ef41Sopenharmony_ci
451cb0ef41Sopenharmony_ci#endif  // V8_OBJECTS_JS_RELATIVE_TIME_FORMAT_INL_H_
46