After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 581664 - Several ISO 8601 related functions aren't wrapped.
Several ISO 8601 related functions aren't wrapped.
Status: RESOLVED FIXED
Product: glibmm
Classification: Bindings
Component: general
2.20.x
Other Linux
: Normal minor
: ---
Assigned To: gtkmm-forge
gtkmm-forge
Depends on:
Blocks:
 
 
Reported: 2009-05-07 00:12 UTC by Krzesimir Nowak
Modified: 2009-07-27 03:29 UTC
See Also:
GNOME target: ---
GNOME version: 2.25/2.26


Attachments
patch adding wrappers to ISO 8601 functions (3.86 KB, patch)
2009-05-07 00:34 UTC, Krzesimir Nowak
none Details | Review
corrected patch adding wrappers to ISO 8601 functions (4.02 KB, patch)
2009-05-18 16:46 UTC, Krzesimir Nowak
none Details | Review
patch adding wrappers to iso8601 functions. (3.51 KB, patch)
2009-07-17 11:30 UTC, Krzesimir Nowak
none Details | Review
Patch adding wrappers to iso8601 functions. (3.59 KB, patch)
2009-07-18 12:41 UTC, Krzesimir Nowak
none Details | Review

Description Krzesimir Nowak 2009-05-07 00:12:38 UTC
These functions are:

1. guint g_date_get_iso8601_week_of_year(const GDate*)
2. gboolean g_time_val_from_iso8601(const gchar*, GTimeVal*)
3. gchar* g_time_val_to_iso8601(GTimeVal*)

I will provide a patch.
Comment 1 Krzesimir Nowak 2009-05-07 00:34:17 UTC
Created attachment 134135 [details] [review]
patch adding wrappers to ISO 8601 functions

1. is wrapped as unsigned int Glib::Date::get_iso8601_week_of_year() const
2. is wrapped as bool Glib::TimeVal::assign_from_iso8601(const Glib::ustring& iso_date)
3. is wrapped as Glib::ustring Glib::TimeVal::as_iso8601() const

I thought about wrapping 2. as a constructor [Glib::TimeVal::TimeVal(const Glib::ustring& iso_date)] but C function may fail and I was wondering what to do in this case - leave instance or initialise to zero. Also, as a method now is consistent with assign_current_time(). Same goes to 3. - now is consistent with as_double().

Patch is untested for now, because it is middle of night (2:31) and I'm sleepy, but I haven't found any typos and such after proofreading.
Comment 2 Krzesimir Nowak 2009-05-18 16:46:21 UTC
Created attachment 134879 [details] [review]
corrected patch adding wrappers to ISO 8601 functions

This patch is tested and corrected - timeval and date files compiles nicely (but glibmm as a whole didn't compile because of some errors during compiling giomm - probably my glib is too old, I don't have g_cancellable_connect and g_cancellable_disconnect).
Comment 3 Krzesimir Nowak 2009-07-17 11:30:20 UTC
Created attachment 138584 [details] [review]
patch adding wrappers to iso8601 functions.

Ping.

I regenerated a patch again, because previous won't apply cleanly due to changes in ChangeLog, but now this patch doesn't add any entries to it, because the patch probably won't be applied soon (like previous one) and I don't want to regenerate it every time something else is commited. As for adding entry to ChangeLog (if needed) - do it yourself, please.
Comment 4 Murray Cumming 2009-07-18 08:36:02 UTC
I'm really sorry for not noticing the patch until now. It looks fine to commit, though:
- it should use guint instead of "unsigned int" - to be consistent.
- it need @newin2p22 in the doxygen comment.
Comment 5 Krzesimir Nowak 2009-07-18 08:59:11 UTC
And I'm sorry for my irritation.

As for unsigned int - in date.(h|cc)g all functions return `unsigned int' instead of `guint' (or `int' instead of `gint'), so I used the former just for consistency.

I'll attach a new patch when this will be clarified.
Comment 6 Murray Cumming 2009-07-18 10:56:11 UTC
OK. It can be either then. At some point I'll change them all later to guint.
Comment 7 Krzesimir Nowak 2009-07-18 12:41:14 UTC
Created attachment 138664 [details] [review]
Patch adding wrappers to iso8601 functions.

Added @newin2p22. Used unsigned int. Conversion to guint should be rather in separate patch in separate bug.
Comment 8 Jonathon Jongsma 2009-07-27 03:29:16 UTC
Sorry, for soem reason I thought this had been applied already.  I've applied it now.