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<JSObject> options, | 64 Handle<JSObject> options, |
65 Handle<JSObject> resolved); | 65 Handle<JSObject> resolved); |
66 | 66 |
67 // Unpacks date format object from corresponding JavaScript object. | 67 // Unpacks date format object from corresponding JavaScript object. |
68 static icu::SimpleDateFormat* UnpackDateFormat(Isolate* isolate, | 68 static icu::SimpleDateFormat* UnpackDateFormat(Isolate* isolate, |
69 Handle<JSObject> obj); | 69 Handle<JSObject> obj); |
70 | 70 |
71 // Release memory we allocated for the DateFormat once the JS object that | 71 // Release memory we allocated for the DateFormat once the JS object that |
72 // holds the pointer gets garbage collected. | 72 // holds the pointer gets garbage collected. |
73 static void DeleteDateFormat(v8::Isolate* isolate, | 73 static void DeleteDateFormat(v8::Isolate* isolate, |
74 Persistent<v8::Object>* object, | 74 Persistent<v8::Value>* object, |
75 void* param); | 75 void* param); |
76 private: | 76 private: |
77 DateFormat(); | 77 DateFormat(); |
78 }; | 78 }; |
79 | 79 |
80 | 80 |
81 class NumberFormat { | 81 class NumberFormat { |
82 public: | 82 public: |
83 // Create a formatter for the specificied locale and options. Returns the | 83 // Create a formatter for the specificied locale and options. Returns the |
84 // resolved settings for the locale / options. | 84 // resolved settings for the locale / options. |
85 static icu::DecimalFormat* InitializeNumberFormat( | 85 static icu::DecimalFormat* InitializeNumberFormat( |
86 Isolate* isolate, | 86 Isolate* isolate, |
87 Handle<String> locale, | 87 Handle<String> locale, |
88 Handle<JSObject> options, | 88 Handle<JSObject> options, |
89 Handle<JSObject> resolved); | 89 Handle<JSObject> resolved); |
90 | 90 |
91 // Unpacks number format object from corresponding JavaScript object. | 91 // Unpacks number format object from corresponding JavaScript object. |
92 static icu::DecimalFormat* UnpackNumberFormat(Isolate* isolate, | 92 static icu::DecimalFormat* UnpackNumberFormat(Isolate* isolate, |
93 Handle<JSObject> obj); | 93 Handle<JSObject> obj); |
94 | 94 |
95 // Release memory we allocated for the NumberFormat once the JS object that | 95 // Release memory we allocated for the NumberFormat once the JS object that |
96 // holds the pointer gets garbage collected. | 96 // holds the pointer gets garbage collected. |
97 static void DeleteNumberFormat(v8::Isolate* isolate, | 97 static void DeleteNumberFormat(v8::Isolate* isolate, |
98 Persistent<v8::Object>* object, | 98 Persistent<v8::Value>* object, |
99 void* param); | 99 void* param); |
100 private: | 100 private: |
101 NumberFormat(); | 101 NumberFormat(); |
102 }; | 102 }; |
103 | 103 |
104 | 104 |
105 class Collator { | 105 class Collator { |
106 public: | 106 public: |
107 // Create a collator for the specificied locale and options. Returns the | 107 // Create a collator for the specificied locale and options. Returns the |
108 // resolved settings for the locale / options. | 108 // resolved settings for the locale / options. |
109 static icu::Collator* InitializeCollator( | 109 static icu::Collator* InitializeCollator( |
110 Isolate* isolate, | 110 Isolate* isolate, |
111 Handle<String> locale, | 111 Handle<String> locale, |
112 Handle<JSObject> options, | 112 Handle<JSObject> options, |
113 Handle<JSObject> resolved); | 113 Handle<JSObject> resolved); |
114 | 114 |
115 // Unpacks collator object from corresponding JavaScript object. | 115 // Unpacks collator object from corresponding JavaScript object. |
116 static icu::Collator* UnpackCollator(Isolate* isolate, Handle<JSObject> obj); | 116 static icu::Collator* UnpackCollator(Isolate* isolate, Handle<JSObject> obj); |
117 | 117 |
118 // Release memory we allocated for the Collator once the JS object that holds | 118 // Release memory we allocated for the Collator once the JS object that holds |
119 // the pointer gets garbage collected. | 119 // the pointer gets garbage collected. |
120 static void DeleteCollator(v8::Isolate* isolate, | 120 static void DeleteCollator(v8::Isolate* isolate, |
121 Persistent<v8::Object>* object, | 121 Persistent<v8::Value>* object, |
122 void* param); | 122 void* param); |
123 private: | 123 private: |
124 Collator(); | 124 Collator(); |
125 }; | 125 }; |
126 | 126 |
127 } } // namespace v8::internal | 127 } } // namespace v8::internal |
128 | 128 |
129 #endif // V8_I18N_H_ | 129 #endif // V8_I18N_H_ |
OLD | NEW |