Debian Codegraph @

js/src/builtin/temporal/ToString.h

raw
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/. */
6
7 #ifndef builtin_temporal_ToString_h
8 #define builtin_temporal_ToString_h
9
10 #include "builtin/temporal/Temporal.h"
11 #include "builtin/temporal/TemporalRoundingMode.h"
12 #include "builtin/temporal/TemporalUnit.h"
13 #include "js/TypeDecls.h"
14
15 namespace js::temporal {
16
17 class CalendarValue;
18 class InstantObject;
19 class PlainDateObject;
20 class PlainMonthDayObject;
21 class PlainYearMonthObject;
22 class TimeZoneValue;
23 class ZonedDateTime;
24
25 struct EpochNanoseconds;
26 struct ISODateTime;
27 struct Time;
28
29 /**
30 * TemporalInstantToString ( instant, timeZone, precision )
31 */
32 JSString* TemporalInstantToString(JSContext* cx,
33 const EpochNanoseconds& epochNs,
34 JS::Handle<TimeZoneValue> timeZone,
35 Precision precision);
36
37 /**
38 * TemporalDateToString ( temporalDate, showCalendar )
39 */
40 JSString* TemporalDateToString(JSContext* cx,
41 JS::Handle<PlainDateObject*> temporalDate,
42 ShowCalendar showCalendar);
43
44 /**
45 * ISODateTimeToString ( isoDateTime, calendar, precision, showCalendar )
46 */
47 JSString* ISODateTimeToString(JSContext* cx, const ISODateTime& isoDateTime,
48 JS::Handle<CalendarValue> calendar,
49 Precision precision, ShowCalendar showCalendar);
50
51 /**
52 * TimeRecordToString ( time, precision )
53 */
54 JSString* TimeRecordToString(JSContext* cx, const Time& time,
55 Precision precision);
56
57 /**
58 * TemporalMonthDayToString ( monthDay, showCalendar )
59 */
60 JSString* TemporalMonthDayToString(JSContext* cx,
61 JS::Handle<PlainMonthDayObject*> monthDay,
62 ShowCalendar showCalendar);
63
64 /**
65 * TemporalYearMonthToString ( yearMonth, showCalendar )
66 */
67 JSString* TemporalYearMonthToString(JSContext* cx,
68 JS::Handle<PlainYearMonthObject*> yearMonth,
69 ShowCalendar showCalendar);
70
71 /**
72 * TemporalZonedDateTimeToString ( zonedDateTime, precision, showCalendar,
73 * showTimeZone, showOffset [ , increment, unit, roundingMode ] )
74 */
75 JSString* TemporalZonedDateTimeToString(
76 JSContext* cx, JS::Handle<ZonedDateTime> zonedDateTime, Precision precision,
77 ShowCalendar showCalendar, ShowTimeZoneName showTimeZone,
78 ShowOffset showOffset, Increment increment = Increment{1},
79 TemporalUnit unit = TemporalUnit::Nanosecond,
80 TemporalRoundingMode roundingMode = TemporalRoundingMode::Trunc);
81
82 } /* namespace js::temporal */
83
84 #endif /* builtin_temporal_ToString_h */