Re: Wrapping gboolean list[] for Glib::KeyFile



On Thu, 2006-02-16 at 22:08 +0000, rob page wrote:
[snip]
> g_key_file_get_boolean_list returns a gboolean*, which works fine,
> however, the Glib::ArrayHandle<bool> constructor requires a bool* as
> its first argument and it doesn't seem able to do an implicit
> conversion from gboolean*.

I think you need to define a TypeTrait that tells the ArrayHandle how to
do the conversion. For instance, see BasicTypeTraits<bool> in gconfmm.

I don't like ArrayHandle<> and friends, even though it is apparently the
correct way to present a container in an C++ API, and if I could break
the API then I would just force people to use either vector or list. But
for now, we need to be consistent. 

> So, I either need a way to convert bool_list from a gboolean* to a bool*
> OR
> I need to be able to convert Glib::ArrayHandle<gboolean> to
> Glib::ArrayHandle<bool>
> 
> Alternatively... I'm not seeing a really obvious way of doing this.
> Which is very possible :-)
> 
> Hope this makes it clearer.
> 
> Rob.
-- 
Murray Cumming
murrayc murrayc com
www.murrayc.com
www.openismus.com




[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]