GNOME Bugzilla – Bug 677064
GString: Tweak documentation, add g_string_free_to_bytes()
Last modified: 2012-07-06 14:20:37 UTC
The docs for GString should really mention GByteArray, and what makes it different. Drop the comparison to Java which is dated and actually inaccurate (because StringBuffer operates on Unicode). While we're here, add g_string_free_to_bytes(), which further complements the spread of GBytes-based API. For example, one can create a buffer using GString, then send it off via g_output_stream_write_bytes().
Created attachment 215223 [details] [review] GString: Tweak documentation, add g_string_free_to_bytes()
Review of attachment 215223 [details] [review]: no complaints about the api itself; fine with me ::: glib/gstring.c @@ +53,3 @@ + * A #GString is an object that handles the memory management of a C + * string for you. The emphasis of #GString is on text, typically + * UTF-8. Crucially, a the "str" member of a #GString is guaranteed typo: a the @@ +54,3 @@ + * string for you. The emphasis of #GString is on text, typically + * UTF-8. Crucially, a the "str" member of a #GString is guaranteed + * to have a trailing NUL character, and it is therefore always safe I believe we generally don't uppercase nul in the docs. If you want to change that, it should be a separate patch that fixes it everywhere. But it increases the risk of confusing terms like nul-terminated and NULL-terminated. @@ +249,3 @@ + */ +GBytes* +g_string_free_to_bytes (GString *string) Unnecessarily wide gap between GString and *string. One space would suffice
Attachment 215223 [details] pushed as 4ac0d78 - GString: Tweak documentation, add g_string_free_to_bytes()