Index: src/extensions/i18n/date-format.h |
diff --git a/src/i18n.h b/src/extensions/i18n/date-format.h |
similarity index 69% |
rename from src/i18n.h |
rename to src/extensions/i18n/date-format.h |
index 37c57b135bfb3626112044eb207d8221fbb51cbb..daa5964e254519faa7a8eef7d7a5d375562bc0ed 100644 |
--- a/src/i18n.h |
+++ b/src/extensions/i18n/date-format.h |
@@ -26,8 +26,8 @@ |
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
// limitations under the License. |
-#ifndef V8_I18N_H_ |
-#define V8_I18N_H_ |
+#ifndef V8_EXTENSIONS_I18N_DATE_FORMAT_H_ |
+#define V8_EXTENSIONS_I18N_DATE_FORMAT_H_ |
#include "unicode/uversion.h" |
#include "v8.h" |
@@ -36,44 +36,36 @@ namespace U_ICU_NAMESPACE { |
class SimpleDateFormat; |
} |
-namespace v8 { |
-namespace internal { |
- |
-class I18N { |
- public: |
- // Creates an ObjectTemplate with one internal field. |
- static Handle<ObjectTemplateInfo> GetTemplate(Isolate* isolate); |
- |
- // Creates an ObjectTemplate with two internal fields. |
- static Handle<ObjectTemplateInfo> GetTemplate2(Isolate* isolate); |
- |
- private: |
- I18N(); |
-}; |
+namespace v8_i18n { |
class DateFormat { |
public: |
- // Create a formatter for the specificied locale and options. Returns the |
- // resolved settings for the locale / options. |
- static icu::SimpleDateFormat* InitializeDateTimeFormat( |
- Isolate* isolate, |
- Handle<String> locale, |
- Handle<JSObject> options, |
- Handle<JSObject> resolved); |
+ static void JSCreateDateTimeFormat( |
+ const v8::FunctionCallbackInfo<v8::Value>& args); |
+ |
+ // Helper methods for various bindings. |
// Unpacks date format object from corresponding JavaScript object. |
- static icu::SimpleDateFormat* UnpackDateFormat(Isolate* isolate, |
- Handle<JSObject> obj); |
+ static icu::SimpleDateFormat* UnpackDateFormat( |
+ v8::Handle<v8::Object> obj); |
// Release memory we allocated for the DateFormat once the JS object that |
// holds the pointer gets garbage collected. |
static void DeleteDateFormat(v8::Isolate* isolate, |
- Persistent<v8::Object>* object, |
+ v8::Persistent<v8::Object>* object, |
void* param); |
+ |
+ // Formats date and returns corresponding string. |
+ static void JSInternalFormat(const v8::FunctionCallbackInfo<v8::Value>& args); |
+ |
+ // Parses date and returns corresponding Date object or undefined if parse |
+ // failed. |
+ static void JSInternalParse(const v8::FunctionCallbackInfo<v8::Value>& args); |
+ |
private: |
DateFormat(); |
}; |
-} } // namespace v8::internal |
+} // namespace v8_i18n |
-#endif // V8_I18N_H_ |
+#endif // V8_EXTENSIONS_I18N_DATE_FORMAT_H_ |