v8
V8 is Google’s open source high-performance JavaScript and WebAssembly engine, written in C++.
Loading...
Searching...
No Matches
js-date-time-format-inl.h
Go to the documentation of this file.
1// Copyright 2018 the V8 project authors. All rights reserved.
2// Use of this source code is governed by a BSD-style license that can be
3// found in the LICENSE file.
4
5#ifndef V8_OBJECTS_JS_DATE_TIME_FORMAT_INL_H_
6#define V8_OBJECTS_JS_DATE_TIME_FORMAT_INL_H_
7
8#ifndef V8_INTL_SUPPORT
9#error Internationalization is expected to be enabled.
10#endif // V8_INTL_SUPPORT
11
13// Include the non-inl header before the rest of the headers.
14
16
17// Has to be the last include (doesn't have include guards):
19
20namespace v8 {
21namespace internal {
22
23#include "torque-generated/src/objects/js-date-time-format-tq-inl.inc"
24
25TQ_OBJECT_CONSTRUCTORS_IMPL(JSDateTimeFormat)
26
27ACCESSORS(JSDateTimeFormat, icu_locale, Tagged<Managed<icu::Locale>>,
28 kIcuLocaleOffset)
30 Tagged<Managed<icu::SimpleDateFormat>>, kIcuSimpleDateFormatOffset)
31ACCESSORS(JSDateTimeFormat, icu_date_interval_format,
32 Tagged<Managed<icu::DateIntervalFormat>>,
33 kIcuDateIntervalFormatOffset)
34
35inline void JSDateTimeFormat::set_hour_cycle(HourCycle hour_cycle) {
36 int hints = flags();
37 hints = HourCycleBits::update(hints, hour_cycle);
38 set_flags(hints);
39}
40
42 return HourCycleBits::decode(flags());
43}
44
47 int hints = flags();
48 hints = DateStyleBits::update(hints, date_style);
49 set_flags(hints);
50}
51
53 return DateStyleBits::decode(flags());
54}
55
58 int hints = flags();
59 hints = TimeStyleBits::update(hints, time_style);
60 set_flags(hints);
61}
62
64 return TimeStyleBits::decode(flags());
65}
66
67} // namespace internal
68} // namespace v8
69
71
72#endif // V8_OBJECTS_JS_DATE_TIME_FORMAT_INL_H_
void set_date_style(DateTimeStyle date_style)
void set_time_style(DateTimeStyle time_style)
Flag flags[]
Definition flags.cc:3797
#define ACCESSORS(holder, name, type, offset)
#define TQ_OBJECT_CONSTRUCTORS_IMPL(Type)