1 // Copyright 2013 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 // limitations under the License.
9 #include "src/handles.h"
10 #include "unicode/uversion.h"
12 namespace U_ICU_NAMESPACE {
16 class SimpleDateFormat;
22 // Forward declarations.
23 class ObjectTemplateInfo;
27 // Creates an ObjectTemplate with one internal field.
28 static Handle<ObjectTemplateInfo> GetTemplate(Isolate* isolate);
30 // Creates an ObjectTemplate with two internal fields.
31 static Handle<ObjectTemplateInfo> GetTemplate2(Isolate* isolate);
40 // Create a formatter for the specificied locale and options. Returns the
41 // resolved settings for the locale / options.
42 static icu::SimpleDateFormat* InitializeDateTimeFormat(
44 Handle<String> locale,
45 Handle<JSObject> options,
46 Handle<JSObject> resolved);
48 // Unpacks date format object from corresponding JavaScript object.
49 static icu::SimpleDateFormat* UnpackDateFormat(Isolate* isolate,
50 Handle<JSObject> obj);
52 // Release memory we allocated for the DateFormat once the JS object that
53 // holds the pointer gets garbage collected.
54 static void DeleteDateFormat(
55 const v8::WeakCallbackData<v8::Value, void>& data);
64 // Create a formatter for the specificied locale and options. Returns the
65 // resolved settings for the locale / options.
66 static icu::DecimalFormat* InitializeNumberFormat(
68 Handle<String> locale,
69 Handle<JSObject> options,
70 Handle<JSObject> resolved);
72 // Unpacks number format object from corresponding JavaScript object.
73 static icu::DecimalFormat* UnpackNumberFormat(Isolate* isolate,
74 Handle<JSObject> obj);
76 // Release memory we allocated for the NumberFormat once the JS object that
77 // holds the pointer gets garbage collected.
78 static void DeleteNumberFormat(
79 const v8::WeakCallbackData<v8::Value, void>& data);
88 // Create a collator for the specificied locale and options. Returns the
89 // resolved settings for the locale / options.
90 static icu::Collator* InitializeCollator(
92 Handle<String> locale,
93 Handle<JSObject> options,
94 Handle<JSObject> resolved);
96 // Unpacks collator object from corresponding JavaScript object.
97 static icu::Collator* UnpackCollator(Isolate* isolate, Handle<JSObject> obj);
99 // Release memory we allocated for the Collator once the JS object that holds
100 // the pointer gets garbage collected.
101 static void DeleteCollator(
102 const v8::WeakCallbackData<v8::Value, void>& data);
108 class BreakIterator {
110 // Create a BreakIterator for the specificied locale and options. Returns the
111 // resolved settings for the locale / options.
112 static icu::BreakIterator* InitializeBreakIterator(
114 Handle<String> locale,
115 Handle<JSObject> options,
116 Handle<JSObject> resolved);
118 // Unpacks break iterator object from corresponding JavaScript object.
119 static icu::BreakIterator* UnpackBreakIterator(Isolate* isolate,
120 Handle<JSObject> obj);
122 // Release memory we allocated for the BreakIterator once the JS object that
123 // holds the pointer gets garbage collected.
124 static void DeleteBreakIterator(
125 const v8::WeakCallbackData<v8::Value, void>& data);
131 } } // namespace v8::internal