5 #ifndef V8_INTL_SUPPORT 6 #error Internationalization is expected to be enabled. 7 #endif // V8_INTL_SUPPORT 9 #ifndef V8_OBJECTS_JS_RELATIVE_TIME_FORMAT_H_ 10 #define V8_OBJECTS_JS_RELATIVE_TIME_FORMAT_H_ 15 #include "src/heap/factory.h" 16 #include "src/isolate.h" 17 #include "src/objects.h" 18 #include "src/objects/managed.h" 19 #include "unicode/uversion.h" 22 #include "src/objects/object-macros.h" 25 class RelativeDateTimeFormatter;
53 static std::set<std::string> GetAvailableLocales();
58 DECL_ACCESSORS2(locale,
String)
72 inline void set_style(Style style);
73 inline Style style()
const;
86 inline void set_numeric(Numeric numeric);
87 inline Numeric numeric()
const;
90 #define FLAGS_BIT_FIELDS(V, _) \ 91 V(StyleBits, Style, 2, _) \ 92 V(NumericBits, Numeric, 1, _) 93 DEFINE_BIT_FIELDS(FLAGS_BIT_FIELDS)
94 #undef FLAGS_BIT_FIELDS 96 STATIC_ASSERT(Style::LONG <= StyleBits::kMax);
97 STATIC_ASSERT(Style::SHORT <= StyleBits::kMax);
98 STATIC_ASSERT(Style::NARROW <= StyleBits::kMax);
99 STATIC_ASSERT(Numeric::AUTO <= NumericBits::kMax);
100 STATIC_ASSERT(Numeric::ALWAYS <= NumericBits::kMax);
103 DECL_INT_ACCESSORS(flags)
109 #define JS_RELATIVE_TIME_FORMAT_FIELDS(V) \ 110 V(kJSRelativeTimeFormatOffset, kTaggedSize) \ 111 V(kLocaleOffset, kTaggedSize) \ 112 V(kICUFormatterOffset, kTaggedSize) \ 113 V(kFlagsOffset, kTaggedSize) \ 117 DEFINE_FIELD_OFFSET_CONSTANTS(JSObject::kHeaderSize,
118 JS_RELATIVE_TIME_FORMAT_FIELDS)
119 #undef JS_RELATIVE_TIME_FORMAT_FIELDS 122 static Style getStyle(
const char* str);
123 static Numeric getNumeric(
const char* str);
131 #include "src/objects/object-macros-undef.h" 133 #endif // V8_OBJECTS_JS_RELATIVE_TIME_FORMAT_H_