Commit 7d9d86fc authored by Kjell Ahlstedt's avatar Kjell Ahlstedt

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().
parent 51a5e47c
......@@ -16,10 +16,4 @@
#include <glibmm/utility.h>
#include <glibmm/timeval.h>
#include <glibmm/timezone.h>
#include <glibmm/wrap.h>
namespace Glib
} // namespace Glib
......@@ -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)
_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)
......@@ -165,6 +165,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
......@@ -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
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment