diff options
author | Oleksij Rempel <bug-track@fisher-privat.net> | 2012-06-12 22:35:42 +0200 |
---|---|---|
committer | Tim-Philipp Müller <tim.muller@collabora.co.uk> | 2012-06-12 22:53:01 +0100 |
commit | 000ebef2f4d649015f6689a13e32d016d126e78f (patch) | |
tree | 5d591f4b94dfcaf254d7014885ff244bb1c3dbb0 /gst/gstdatetime.h | |
parent | d916018021c4181cd1e188e02684e1cf4389cfdd (diff) | |
download | gstreamer-000ebef2f4d649015f6689a13e32d016d126e78f.tar.gz |
datetime: allow GstDateTime where not all fields are set
In order to deserialise and re-serialise dates and date times
from tags properly, we need to be able to express partial
dates (e.g. YYYY or YYYY-MM) and date times.
We only support partial date times where all the more
significant fields above the first unset field are set
(e.g. YYYY-00-DD is not supported).
Calling _get_foo() when foo is not set is not allowed
any more, callers need to check which fields are set
first.
https://bugzilla.gnome.org/show_bug.cgi?id=677757
Diffstat (limited to 'gst/gstdatetime.h')
-rw-r--r-- | gst/gstdatetime.h | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/gst/gstdatetime.h b/gst/gstdatetime.h index 96d8bbdb7b..d613571b85 100644 --- a/gst/gstdatetime.h +++ b/gst/gstdatetime.h @@ -36,6 +36,13 @@ G_BEGIN_DECLS */ typedef struct _GstDateTime GstDateTime; +gboolean gst_date_time_has_year (const GstDateTime * datetime); +gboolean gst_date_time_has_month (const GstDateTime * datetime); +gboolean gst_date_time_has_day (const GstDateTime * datetime); +gboolean gst_date_time_has_hour (const GstDateTime * datetime); +gboolean gst_date_time_has_minute (const GstDateTime * datetime); +gboolean gst_date_time_has_second (const GstDateTime * datetime); + gint gst_date_time_get_year (const GstDateTime * datetime); gint gst_date_time_get_month (const GstDateTime * datetime); gint gst_date_time_get_day (const GstDateTime * datetime); @@ -51,6 +58,15 @@ GstDateTime * gst_date_time_new_local_time (gint year, gint month, gint day, gint hour, gint minute, gdouble seconds) G_GNUC_MALLOC; +GstDateTime * gst_date_time_new_y (gint year) G_GNUC_MALLOC; +GstDateTime * gst_date_time_new_ym (gint year, gint month) G_GNUC_MALLOC; +GstDateTime * gst_date_time_new_ymd (gint year, gint month, + gint day) G_GNUC_MALLOC; +GstDateTime * gst_date_time_new_ymd_h (gint year, gint month, + gint day, gint hour) G_GNUC_MALLOC; +GstDateTime * gst_date_time_new_ymd_hm (gint year, gint month, + gint day, gint hour, + gint minute) G_GNUC_MALLOC; GstDateTime * gst_date_time_new (gfloat tzoffset, gint year, gint month, gint day, gint hour, |