summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKjell Ahlstedt <kjellahlstedt@gmail.com>2019-03-18 19:13:47 +0100
committerKjell Ahlstedt <kjellahlstedt@gmail.com>2019-03-18 19:13:47 +0100
commit652312bed8fcebf2e7cb4d08374456cc7326da25 (patch)
tree871a5ac0513ecfd1d0ced73e2ffae025bf70e3cc
parent96294526baa9c1401eb1eea19c61a60dc85c6cfd (diff)
downloadglibmm-652312bed8fcebf2e7cb4d08374456cc7326da25.tar.gz
Glib: Add some API (DateTime::get_timezone() etc.)
* glib/src/datetime.[ccg|hg]: Add get_timezone(). * glib/src/keyfile.hg: Add get_locale_for_key(). * glib/src/timezone.hg: Add get_identifier().
-rw-r--r--glib/src/datetime.ccg6
-rw-r--r--glib/src/datetime.hg6
-rw-r--r--glib/src/keyfile.hg4
-rw-r--r--glib/src/timezone.hg1
4 files changed, 9 insertions, 8 deletions
diff --git a/glib/src/datetime.ccg b/glib/src/datetime.ccg
index fbad36e9..3295b3e4 100644
--- a/glib/src/datetime.ccg
+++ b/glib/src/datetime.ccg
@@ -16,10 +16,4 @@
#include <glibmm/utility.h>
#include <glibmm/timeval.h>
-#include <glibmm/timezone.h>
#include <glibmm/wrap.h>
-
-namespace Glib
-{
-
-} // namespace Glib
diff --git a/glib/src/datetime.hg b/glib/src/datetime.hg
index 6665950d..ac6e81da 100644
--- a/glib/src/datetime.hg
+++ b/glib/src/datetime.hg
@@ -18,6 +18,7 @@ _DEFS(glibmm,glib)
#include <glibmmconfig.h>
#include <glibmm/refptr.h>
+#include <glibmm/timezone.h>
#include <glibmm/ustring.h>
#include <glib.h>
@@ -29,7 +30,6 @@ namespace Glib
{
struct TimeVal;
-class TimeZone;
/** A value representing an interval of time, in microseconds. As GTimeSpan,
* its underlying type is gint64.
@@ -66,7 +66,7 @@ class DateTime
_IGNORE(g_date_time_ref, g_date_time_unref)
public:
- _WRAP_METHOD(static DateTime create_now(const TimeZone& tz), g_date_time_new_now)
+ _WRAP_METHOD(static DateTime create_now(const TimeZone& tz), g_date_time_new_now)
_WRAP_METHOD(static DateTime create_now_local(), g_date_time_new_now_local)
_WRAP_METHOD(static DateTime create_now_utc(), g_date_time_new_now_utc)
@@ -143,6 +143,8 @@ public:
_WRAP_METHOD(gint64 to_unix() const, g_date_time_to_unix)
_WRAP_METHOD(bool to_timeval(TimeVal& tv) const, g_date_time_to_timeval)
_WRAP_METHOD(TimeSpan get_utc_offset() const, g_date_time_get_utc_offset)
+#m4 _CONVERSION(`GTimeZone*',`TimeZone',`Glib::wrap($3, true)')
+ _WRAP_METHOD(TimeZone get_timezone() const, g_date_time_get_timezone, newin "2,60")
_WRAP_METHOD(Glib::ustring get_timezone_abbreviation() const, g_date_time_get_timezone_abbreviation)
_WRAP_METHOD(bool is_daylight_savings() const, g_date_time_is_daylight_savings)
_WRAP_METHOD(DateTime to_timezone(const TimeZone& tz) const, g_date_time_to_timezone)
diff --git a/glib/src/keyfile.hg b/glib/src/keyfile.hg
index 80cd0ba8..899ebf24 100644
--- a/glib/src/keyfile.hg
+++ b/glib/src/keyfile.hg
@@ -192,6 +192,10 @@ public:
_WRAP_METHOD(Glib::ustring get_value(const Glib::ustring& group_name, const Glib::ustring& key) const, g_key_file_get_value, errthrow)
_WRAP_METHOD(Glib::ustring get_string(const Glib::ustring& group_name, const Glib::ustring& key) const, g_key_file_get_string, errthrow)
+ _WRAP_METHOD(Glib::ustring get_locale_for_key(const Glib::ustring& group_name,
+ const Glib::ustring& key, const Glib::ustring& locale{NULL} = {}) const,
+ g_key_file_get_locale_for_key, newin "2,60")
+
/** Gets the value associated with @a key under @a group_name translated
* into the current locale.
* @return the value as a Glib::ustring
diff --git a/glib/src/timezone.hg b/glib/src/timezone.hg
index 1a033765..afa2f7fd 100644
--- a/glib/src/timezone.hg
+++ b/glib/src/timezone.hg
@@ -66,6 +66,7 @@ public:
_WRAP_METHOD(Glib::ustring get_abbreviation(int interval) const, g_time_zone_get_abbreviation)
_WRAP_METHOD(gint32 get_offset(int interval) const, g_time_zone_get_offset)
_WRAP_METHOD(bool is_dst(int interval) const, g_time_zone_is_dst)
+ _WRAP_METHOD(Glib::ustring get_identifier() const, g_time_zone_get_identifier, newin "2,60")
};
} // namespace Glib