128 Commits

Author SHA1 Message Date
Ryan Lortie
b205dc77cb GVariant: add g_variant_default_value()
Returns various kinds of false, zero, empty arrays, etc.
2010-06-16 15:58:53 -04:00
Ryan Lortie
8d3fea9cff Mention GVariant format string docs from iter docs
It's not entirely clear what @format_string in iter_next() and
iter_loop() should be.  Include a link to the GVariant format string
docs as a hint.
2010-06-10 08:07:34 -04:00
Ryan Lortie
44db2b6b74 Bug 620349 – utf8ify GVariant printer
Take advantage of our knowledge that GVariant strings are always valid
utf8 when printing and parsing:

  - allow valid printing unicode characters to pass through unescaped

  - escape non-printing characters using \uxxxx or \Uxxxxxxxx format

  - do the same in the parser

  - update existing test cases to use utf8, add a new test case
2010-06-03 09:41:33 +02:00
Milan Bouchet-Valat
3682666140 Annotate GVariant and GSettings _strv() functions
Add GObject introspection annotations so that the length parameter is
correctly detected for g_variant_new_strv(), g_variant_get_strv() and
g_variant_dup_strv(). Also specify that it can be a NULL pointer in
g_variant_get_strv() and g_variant_dup_strv().

For g_settings_set_strv(), detect that a NULL value is allowed, meaning
empty array.

Closes bug #620384.

Signed-off-by: Ryan Lortie <desrt@desrt.ca>
2010-06-02 19:37:30 +02:00
Richard Hughes
100df5287d Fix up a typo in the g_variant_builder_add() docs 2010-05-24 17:22:38 +01:00
Ryan Lortie
c57c61c930 fix glaring inaccuracy in GVariant docs 2010-05-14 17:08:01 +02:00
Ryan Lortie
a52b6f7df2 Add g_variant_{new,get}_byte_array()
Now that strings are strictly utf8 this provides a convenient API for
storing non-utf8 string data.
2010-04-25 19:12:14 -05:00
Ryan Lortie
9eeab5868f GVariant: strings are now utf8
- modify serialiser validation function to enforce utf8 encoding
 - add documentation to g_variant_new_string(), g_variant_get_string(),
   g_variant_dup_string()
 - add 2 new test cases to check that it works
2010-04-25 13:39:20 -05:00
Matthias Clasen
b2ee97d00d Fix up g_variant_compare addition 2010-04-22 20:49:20 -04:00
Ryan Lortie
5445ae78c2 Add g_variant_compare() for like basic types 2010-04-20 10:37:58 -04:00
Ryan Lortie
d17f4bee17 GVariant: fix for g_variant_iter_loop() 2010-04-14 23:36:23 -04:00
Ryan Lortie
3349bab022 Add g_return_if_fail()s to g_variant_new_from_data()
also, document that @type must be definite
2010-04-10 22:01:02 -04:00
Ryan Lortie
a6c57591c0 Support &s as key of dict entry in format string
Partial fix for bug 613618.
2010-03-23 09:18:28 -05:00
Ryan Lortie
bf4dbdbf0e merge GVariant parser 2010-03-21 12:55:30 -05:00
Tor Lillqvist
2ab76c5b36 Make the GVariant code compile with a non-gcc compiler
In particular, tested with Microsoft Visual C 2008.
2010-03-21 11:22:06 +02:00
Christian Persch
1953b4087f Use static assert over runtime assert if possible
We can test the these at compile time. Bug #609231.
2010-03-15 15:49:03 -04:00
Ryan Lortie
9dea0253a3 GVariant: add loading, byteswapping, normalisation 2010-03-14 15:56:18 -04:00
Ryan Lortie
056feef60b GVariantIter: expand the size of the dummy struct
Will allow for some nice tricks in the future.
2010-03-14 15:56:17 -04:00
Dagobert Michelsen
89fa967ba1 Use G_STRFUNC instead of explicit gcc-only __PRETTY_FUNC__ 2010-03-09 10:30:06 -05:00
Ryan Lortie
75f761bcaa GVariant variable arguments, tests, cleanups
Merge GVariant variable arguments support and put it under tests.

Also, remove the hack of the test case directly '#include'ing .c files
from glib/.  Instead, create a non-installed gvariant-internal.h that
the tests can include and make the symbols in it visible on the symbol
table of the shared library.  These symbols (as they are present in no
installed header files) are not part of the API of GLib.

Increase test coverage in a few other areas.
2010-03-08 10:31:19 -05:00
Ryan Lortie
7026365db2 g_variant_get_strv: support objects and signatures 2010-03-05 06:14:36 -05:00
Ryan Lortie
118d59ba15 GVariant: fix some refcounting issues 2010-03-05 06:14:26 -05:00
Ryan Lortie
560f518743 GVariantBuilder: loosen assertion check
Don't check that a GVariantBuilder is fully-valid for use when
performing refcounting operations, as these operations may be occuring
after the builder has already been cleared.
2010-03-03 11:38:14 -05:00
Ryan Lortie
fe6e278a87 GVariantBuilder: allow for stack allocation 2010-03-03 03:38:02 -05:00
Ryan Lortie
1f66523ad3 Fix backward logic in g_return_if_fail(). 2010-02-23 02:00:11 -05:00
Ryan Lortie
515434bdcb GVariantIter, GVariantBuilder 2010-02-22 00:39:01 -05:00
Matthias Clasen
ecb45f4382 Fix an oversight
_Always_ explicitly compare strcmp to 0... this was pointed out in
bug 610484 by Christian Persch.
2010-02-21 15:28:04 -05:00
Ryan Lortie
ed3c914cdb Merge the main public API of GVariant 2010-02-19 10:52:03 -05:00