Re: [Vala] Writing objects to files

2018-03-28 Thread Christian Hergert
On 03/28/2018 10:44 AM, Steven Oliver wrote: > > On the other hand, though, if you throw in some kind of data structure > besides your basic types (int, string, etc.) it completely fails. https://developer.gnome.org/json-glib/stable/json-glib-Serializable-Interface.html#JsonSerializableIface If

Re: [Vala] Writing objects to files

2018-03-28 Thread Steven Oliver
I have not tried gom yet, but I did try the Json.gobject_serialize() method as described by Christian Hergert. It almost does what I need it to. It has some odd limitations. For example, if this is your object everything works exactly as you would expect. public class MyObject : Object { publ

Re: [Vala] Writing objects to files

2018-03-26 Thread Vivien Kraus
Hello, I don't know what it's worth, but if you prefer XML this seems to be a good solution: https://blogs.gnome.org/despinosa/2016/05/04/howto-gobje ct-serialization-to-xml-using-gxml/ Vivien Le lundi 26 mars 2018 à 14:02 -0700, Christian Hergert a écrit : > On 03/26/2018 11:44 AM, Steven Olive

Re: [Vala] Writing objects to files

2018-03-26 Thread Christian Hergert
On 03/26/2018 11:44 AM, Steven Oliver wrote: > I want to implement "saving" in my program. The data I want to save is > a custom object. Is it possible in vala to simply write the object to > disk (in binary I assume) without having to implement a to_string > method? > > It seems like such a simpl

[Vala] Writing objects to files

2018-03-26 Thread Steven Oliver
I want to implement "saving" in my program. The data I want to save is a custom object. Is it possible in vala to simply write the object to disk (in binary I assume) without having to implement a to_string method? It seems like such a simple concept yet i can't seem to figure out how to do it in