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;
24 // Creates an ObjectTemplate with one internal field.
25 static Handle<ObjectTemplateInfo> GetTemplate(Isolate* isolate);
27 // Creates an ObjectTemplate with two internal fields.
28 static Handle<ObjectTemplateInfo> GetTemplate2(Isolate* isolate);
37 // Create a formatter for the specificied locale and options. Returns the
38 // resolved settings for the locale / options.
39 static icu::SimpleDateFormat* InitializeDateTimeFormat(
41 Handle<String> locale,
42 Handle<JSObject> options,
43 Handle<JSObject> resolved);
45 // Unpacks date format object from corresponding JavaScript object.
46 static icu::SimpleDateFormat* UnpackDateFormat(Isolate* isolate,
47 Handle<JSObject> obj);
49 // Release memory we allocated for the DateFormat once the JS object that
50 // holds the pointer gets garbage collected.
51 static void DeleteDateFormat(
52 const v8::WeakCallbackData<v8::Value, void>& data);
61 // Create a formatter for the specificied locale and options. Returns the
62 // resolved settings for the locale / options.
63 static icu::DecimalFormat* InitializeNumberFormat(
65 Handle<String> locale,
66 Handle<JSObject> options,
67 Handle<JSObject> resolved);
69 // Unpacks number format object from corresponding JavaScript object.
70 static icu::DecimalFormat* UnpackNumberFormat(Isolate* isolate,
71 Handle<JSObject> obj);
73 // Release memory we allocated for the NumberFormat once the JS object that
74 // holds the pointer gets garbage collected.
75 static void DeleteNumberFormat(
76 const v8::WeakCallbackData<v8::Value, void>& data);
85 // Create a collator for the specificied locale and options. Returns the
86 // resolved settings for the locale / options.
87 static icu::Collator* InitializeCollator(
89 Handle<String> locale,
90 Handle<JSObject> options,
91 Handle<JSObject> resolved);
93 // Unpacks collator object from corresponding JavaScript object.
94 static icu::Collator* UnpackCollator(Isolate* isolate, Handle<JSObject> obj);
96 // Release memory we allocated for the Collator once the JS object that holds
97 // the pointer gets garbage collected.
98 static void DeleteCollator(
99 const v8::WeakCallbackData<v8::Value, void>& data);
105 class BreakIterator {
107 // Create a BreakIterator for the specificied locale and options. Returns the
108 // resolved settings for the locale / options.
109 static icu::BreakIterator* InitializeBreakIterator(
111 Handle<String> locale,
112 Handle<JSObject> options,
113 Handle<JSObject> resolved);
115 // Unpacks break iterator object from corresponding JavaScript object.
116 static icu::BreakIterator* UnpackBreakIterator(Isolate* isolate,
117 Handle<JSObject> obj);
119 // Release memory we allocated for the BreakIterator once the JS object that
120 // holds the pointer gets garbage collected.
121 static void DeleteBreakIterator(
122 const v8::WeakCallbackData<v8::Value, void>& data);
128 } } // namespace v8::internal