summaryrefslogtreecommitdiff
path: root/mobile_src/TimeUtil/TimeUtilTools.h
diff options
context:
space:
mode:
Diffstat (limited to 'mobile_src/TimeUtil/TimeUtilTools.h')
-rwxr-xr-xmobile_src/TimeUtil/TimeUtilTools.h63
1 files changed, 63 insertions, 0 deletions
diff --git a/mobile_src/TimeUtil/TimeUtilTools.h b/mobile_src/TimeUtil/TimeUtilTools.h
new file mode 100755
index 0000000..4635672
--- /dev/null
+++ b/mobile_src/TimeUtil/TimeUtilTools.h
@@ -0,0 +1,63 @@
+//
+// Tizen Web Device API
+// Copyright (c) 2012 Samsung Electronics Co., Ltd.
+//
+// Licensed under the Apache License, Version 2.0 (the License);
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+//
+
+
+
+
+#ifndef _TIMEUTILTOOLS_H_
+#define _TIMEUTILTOOLS_H_
+
+#include <unicode/unistr.h>
+#include <unicode/timezone.h>
+#include <unicode/calendar.h>
+#include <ctime>
+
+namespace DeviceAPI {
+namespace Time {
+
+#define MILLISTOSEC 1000
+
+class TimeUtilTools
+{
+
+ public:
+ enum DateTimeFormatType {
+ TIME_FORMAT,
+ DATE_FORMAT,
+ DATE_SHORT_FORMAT,
+ DATETIME_FORMAT
+ };
+ TimeUtilTools() {}
+ virtual ~TimeUtilTools() {}
+ long tolong(const int32_t num);
+ int32_t toint32_t(const long long num);
+ int32_t toint32_t(const long num);
+ int32_t toint32_t(const int num);
+ UnicodeString *toUnicodeString(const std::string str);
+ std::string toString(UnicodeString uniStr);
+ TimeZone *makeTimeZone(const std::string &name);
+ bool compareTimeZoneName(Calendar *cal, const std::string &name);
+ void printDate(Calendar *cal);
+ UnicodeString getDateTimeFormat(DateTimeFormatType type, bool bLocale);
+ Locale *getDefaultLocale();
+ std::string getDefaultTimezone();
+};
+
+}
+}
+
+#endif /* _TIMEUTILTOOLS_H_ */