Re: [Vala] Stacked arrays in Vala



Ops... It seems my editor doesn't like a copy&paste from my editor...

[DBus (name = "org.freedesktop.UDisks2.Filesystem")]
interface Filesystem_if : GLib.Object {
    public abstract uint64 Size { owned get; }
    [DBus (signature = "aay")]
    public abstract Variant MountPoints { owned get; }

    public abstract async void Mount(GLib.HashTable<string, Variant>options, outstringmount_path) throwsGLib.IOError, GLib.DBusError;     public abstract async void Unmount(GLib.HashTable<string, Variant>options) throwsGLib.IOError, GLib.DBusError;
}


El 06/05/18 a las 23:58, rastersoft escribió:
I tried it and seems to work. Thanks!

Just in case, to allow people to see exactly how it is (the "MountPoints" property):

[DBus(name ="org.freedesktop.UDisks2.Filesystem")]
interfaceFilesystem_if:GLib.Object{
publicabstractuint64Size{ ownedget;}
    [DBus(signature="aay")]
publicabstractVariant MountPoints { ownedget;}
publicabstractasyncvoidMount(GLib.HashTable<string, Variant>options, outstringmount_path) throwsGLib.IOError, GLib.DBusError; publicabstractasyncvoidUnmount(GLib.HashTable<string, Variant>options) throwsGLib.IOError, GLib.DBusError;
}

El 06/05/18 a las 23:31, Jiří Janoušek escribió:
I've never tried that, but how about `[DBus (signature="aay")] Variant foo`?

https://wiki.gnome.org/Projects/Vala/Manual/Attributes#DBus_Attribute

Best regards,

Jiri Janousek
On Sun, 6 May 2018 at 20:33, rastersoft <raster rastersoft com> wrote:

An extra tip about the problem: I tried to use
       uint8[,] Property;
and it seems to work as long as the outmost array has zero or one
entries; if there are two or more entries, it gives trash.

El 06/05/18 a las 17:50, rastersoft escribió:
Hi all:

I'm trying to use a DBus interface that returns an array of arrays of
uint8 ("aay" in dbus syntax). The problem is that I don't know how to
create the interface in Vala, because if I try to use:

     uint8[][] Property;

it says "error: Stacked arrays are not supported"

Can someone give me a hint?

Thanks.

_______________________________________________
vala-list mailing list
vala-list gnome org
https://mail.gnome.org/mailman/listinfo/vala-list
_______________________________________________
vala-list mailing list
vala-list gnome org
https://mail.gnome.org/mailman/listinfo/vala-list

_______________________________________________
vala-list mailing list
vala-list gnome org
https://mail.gnome.org/mailman/listinfo/vala-list



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