V8 API Reference, 7.2.502.16 (for Deno 0.2.4)
js-plural-rules-inl.h
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_INTL_SUPPORT
6 #error Internationalization is expected to be enabled.
7 #endif // V8_INTL_SUPPORT
8 
9 #ifndef V8_OBJECTS_JS_PLURAL_RULES_INL_H_
10 #define V8_OBJECTS_JS_PLURAL_RULES_INL_H_
11 
12 #include "src/api-inl.h"
13 #include "src/objects-inl.h"
14 #include "src/objects/js-plural-rules.h"
15 
16 // Has to be the last include (doesn't have include guards):
17 #include "src/objects/object-macros.h"
18 
19 namespace v8 {
20 namespace internal {
21 
22 ACCESSORS2(JSPluralRules, locale, String, kLocaleOffset)
23 SMI_ACCESSORS(JSPluralRules, flags, kFlagsOffset)
24 ACCESSORS(JSPluralRules, icu_plural_rules, Managed<icu::PluralRules>,
25  kICUPluralRulesOffset)
26 ACCESSORS(JSPluralRules, icu_decimal_format, Managed<icu::DecimalFormat>,
27  kICUDecimalFormatOffset)
28 
29 inline void JSPluralRules::set_type(Type type) {
30  DCHECK_LT(type, Type::COUNT);
31  int hints = flags();
32  hints = TypeBits::update(hints, type);
33  set_flags(hints);
34 }
35 
36 inline JSPluralRules::Type JSPluralRules::type() const {
37  return TypeBits::decode(flags());
38 }
39 
40 CAST_ACCESSOR(JSPluralRules);
41 
42 } // namespace internal
43 } // namespace v8
44 
45 #include "src/objects/object-macros-undef.h"
46 
47 #endif // V8_OBJECTS_JS_PLURAL_RULES_INL_H_
Definition: libplatform.h:13