OLD | NEW |
1 // Copyright 2013 the V8 project authors. All rights reserved. | 1 // Copyright 2013 the V8 project authors. All rights reserved. |
2 // Redistribution and use in source and binary forms, with or without | 2 // Redistribution and use in source and binary forms, with or without |
3 // modification, are permitted provided that the following conditions are | 3 // modification, are permitted provided that the following conditions are |
4 // met: | 4 // met: |
5 // | 5 // |
6 // * Redistributions of source code must retain the above copyright | 6 // * Redistributions of source code must retain the above copyright |
7 // notice, this list of conditions and the following disclaimer. | 7 // notice, this list of conditions and the following disclaimer. |
8 // * Redistributions in binary form must reproduce the above | 8 // * Redistributions in binary form must reproduce the above |
9 // copyright notice, this list of conditions and the following | 9 // copyright notice, this list of conditions and the following |
10 // disclaimer in the documentation and/or other materials provided | 10 // disclaimer in the documentation and/or other materials provided |
(...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
64 Handle<String> locale, | 64 Handle<String> locale, |
65 Handle<JSObject> options, | 65 Handle<JSObject> options, |
66 Handle<JSObject> resolved); | 66 Handle<JSObject> resolved); |
67 | 67 |
68 // Unpacks date format object from corresponding JavaScript object. | 68 // Unpacks date format object from corresponding JavaScript object. |
69 static icu::SimpleDateFormat* UnpackDateFormat(Isolate* isolate, | 69 static icu::SimpleDateFormat* UnpackDateFormat(Isolate* isolate, |
70 Handle<JSObject> obj); | 70 Handle<JSObject> obj); |
71 | 71 |
72 // Release memory we allocated for the DateFormat once the JS object that | 72 // Release memory we allocated for the DateFormat once the JS object that |
73 // holds the pointer gets garbage collected. | 73 // holds the pointer gets garbage collected. |
74 static void DeleteDateFormat(v8::Isolate* isolate, | 74 static void DeleteDateFormat( |
75 Persistent<v8::Value>* object, | 75 const v8::WeakCallbackData<v8::Value, void>& data); |
76 void* param); | 76 |
77 private: | 77 private: |
78 DateFormat(); | 78 DateFormat(); |
79 }; | 79 }; |
80 | 80 |
81 | 81 |
82 class NumberFormat { | 82 class NumberFormat { |
83 public: | 83 public: |
84 // Create a formatter for the specificied locale and options. Returns the | 84 // Create a formatter for the specificied locale and options. Returns the |
85 // resolved settings for the locale / options. | 85 // resolved settings for the locale / options. |
86 static icu::DecimalFormat* InitializeNumberFormat( | 86 static icu::DecimalFormat* InitializeNumberFormat( |
87 Isolate* isolate, | 87 Isolate* isolate, |
88 Handle<String> locale, | 88 Handle<String> locale, |
89 Handle<JSObject> options, | 89 Handle<JSObject> options, |
90 Handle<JSObject> resolved); | 90 Handle<JSObject> resolved); |
91 | 91 |
92 // Unpacks number format object from corresponding JavaScript object. | 92 // Unpacks number format object from corresponding JavaScript object. |
93 static icu::DecimalFormat* UnpackNumberFormat(Isolate* isolate, | 93 static icu::DecimalFormat* UnpackNumberFormat(Isolate* isolate, |
94 Handle<JSObject> obj); | 94 Handle<JSObject> obj); |
95 | 95 |
96 // Release memory we allocated for the NumberFormat once the JS object that | 96 // Release memory we allocated for the NumberFormat once the JS object that |
97 // holds the pointer gets garbage collected. | 97 // holds the pointer gets garbage collected. |
98 static void DeleteNumberFormat(v8::Isolate* isolate, | 98 static void DeleteNumberFormat( |
99 Persistent<v8::Value>* object, | 99 const v8::WeakCallbackData<v8::Value, void>& data); |
100 void* param); | 100 |
101 private: | 101 private: |
102 NumberFormat(); | 102 NumberFormat(); |
103 }; | 103 }; |
104 | 104 |
105 | 105 |
106 class Collator { | 106 class Collator { |
107 public: | 107 public: |
108 // Create a collator for the specificied locale and options. Returns the | 108 // Create a collator for the specificied locale and options. Returns the |
109 // resolved settings for the locale / options. | 109 // resolved settings for the locale / options. |
110 static icu::Collator* InitializeCollator( | 110 static icu::Collator* InitializeCollator( |
111 Isolate* isolate, | 111 Isolate* isolate, |
112 Handle<String> locale, | 112 Handle<String> locale, |
113 Handle<JSObject> options, | 113 Handle<JSObject> options, |
114 Handle<JSObject> resolved); | 114 Handle<JSObject> resolved); |
115 | 115 |
116 // Unpacks collator object from corresponding JavaScript object. | 116 // Unpacks collator object from corresponding JavaScript object. |
117 static icu::Collator* UnpackCollator(Isolate* isolate, Handle<JSObject> obj); | 117 static icu::Collator* UnpackCollator(Isolate* isolate, Handle<JSObject> obj); |
118 | 118 |
119 // Release memory we allocated for the Collator once the JS object that holds | 119 // Release memory we allocated for the Collator once the JS object that holds |
120 // the pointer gets garbage collected. | 120 // the pointer gets garbage collected. |
121 static void DeleteCollator(v8::Isolate* isolate, | 121 static void DeleteCollator( |
122 Persistent<v8::Value>* object, | 122 const v8::WeakCallbackData<v8::Value, void>& data); |
123 void* param); | 123 |
124 private: | 124 private: |
125 Collator(); | 125 Collator(); |
126 }; | 126 }; |
127 | 127 |
128 class BreakIterator { | 128 class BreakIterator { |
129 public: | 129 public: |
130 // Create a BreakIterator for the specificied locale and options. Returns the | 130 // Create a BreakIterator for the specificied locale and options. Returns the |
131 // resolved settings for the locale / options. | 131 // resolved settings for the locale / options. |
132 static icu::BreakIterator* InitializeBreakIterator( | 132 static icu::BreakIterator* InitializeBreakIterator( |
133 Isolate* isolate, | 133 Isolate* isolate, |
134 Handle<String> locale, | 134 Handle<String> locale, |
135 Handle<JSObject> options, | 135 Handle<JSObject> options, |
136 Handle<JSObject> resolved); | 136 Handle<JSObject> resolved); |
137 | 137 |
138 // Unpacks break iterator object from corresponding JavaScript object. | 138 // Unpacks break iterator object from corresponding JavaScript object. |
139 static icu::BreakIterator* UnpackBreakIterator(Isolate* isolate, | 139 static icu::BreakIterator* UnpackBreakIterator(Isolate* isolate, |
140 Handle<JSObject> obj); | 140 Handle<JSObject> obj); |
141 | 141 |
142 // Release memory we allocated for the BreakIterator once the JS object that | 142 // Release memory we allocated for the BreakIterator once the JS object that |
143 // holds the pointer gets garbage collected. | 143 // holds the pointer gets garbage collected. |
144 static void DeleteBreakIterator(v8::Isolate* isolate, | 144 static void DeleteBreakIterator( |
145 Persistent<v8::Value>* object, | 145 const v8::WeakCallbackData<v8::Value, void>& data); |
146 void* param); | |
147 | 146 |
148 private: | 147 private: |
149 BreakIterator(); | 148 BreakIterator(); |
150 }; | 149 }; |
151 | 150 |
152 } } // namespace v8::internal | 151 } } // namespace v8::internal |
153 | 152 |
154 #endif // V8_I18N_H_ | 153 #endif // V8_I18N_H_ |
OLD | NEW |