1 /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*-
2 * vim: set ts=8 sts=2 et sw=2 tw=80:
3 * This Source Code Form is subject to the terms of the Mozilla Public
4 * License, v. 2.0. If a copy of the MPL was not distributed with this
5 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
7 #ifndef builtin_temporal_ToString_h
8 #define builtin_temporal_ToString_h
10 #include "builtin/temporal/Temporal.h"
11 #include "builtin/temporal/TemporalRoundingMode.h"
12 #include "builtin/temporal/TemporalUnit.h"
13 #include "js/TypeDecls.h"
15 namespace js::temporal
{
19 class PlainDateObject
;
20 class PlainMonthDayObject
;
21 class PlainYearMonthObject
;
29 * TemporalInstantToString ( instant, timeZone, precision )
31 JSString
* TemporalInstantToString(JSContext
* cx
,
32 JS::Handle
<InstantObject
*> instant
,
33 JS::Handle
<TimeZoneValue
> timeZone
,
37 * TemporalDateToString ( temporalDate, showCalendar )
39 JSString
* TemporalDateToString(JSContext
* cx
,
40 JS::Handle
<PlainDateObject
*> temporalDate
,
41 CalendarOption showCalendar
);
44 * TemporalDateTimeToString ( isoYear, isoMonth, isoDay, hour, minute, second,
45 * millisecond, microsecond, nanosecond, calendar, precision, showCalendar )
47 JSString
* TemporalDateTimeToString(JSContext
* cx
, const PlainDateTime
& dateTime
,
48 JS::Handle
<CalendarValue
> calendar
,
50 CalendarOption showCalendar
);
53 * TemporalTimeToString ( hour, minute, second, millisecond, microsecond,
54 * nanosecond, precision )
56 JSString
* TemporalTimeToString(JSContext
* cx
, const PlainTime
& time
,
60 * TemporalMonthDayToString ( monthDay, showCalendar )
62 JSString
* TemporalMonthDayToString(JSContext
* cx
,
63 JS::Handle
<PlainMonthDayObject
*> monthDay
,
64 CalendarOption showCalendar
);
67 * TemporalYearMonthToString ( yearMonth, showCalendar )
69 JSString
* TemporalYearMonthToString(JSContext
* cx
,
70 JS::Handle
<PlainYearMonthObject
*> yearMonth
,
71 CalendarOption showCalendar
);
74 * TemporalZonedDateTimeToString ( zonedDateTime, precision, showCalendar,
75 * showTimeZone, showOffset [ , increment, unit, roundingMode ] )
77 JSString
* TemporalZonedDateTimeToString(
78 JSContext
* cx
, JS::Handle
<ZonedDateTime
> zonedDateTime
, Precision precision
,
79 CalendarOption showCalendar
, TimeZoneNameOption showTimeZone
,
80 ShowOffsetOption showOffset
, Increment increment
= Increment
{1},
81 TemporalUnit unit
= TemporalUnit::Nanosecond
,
82 TemporalRoundingMode roundingMode
= TemporalRoundingMode::Trunc
);
84 } /* namespace js::temporal */
86 #endif /* builtin_temporal_ToString_h */