[Vala] A few newbie's questions



Hi to all!
    A few days ago I discovered vala and decided to give it a try, as it
seems to have almost all the features that I wanted (C code generation,
non-object oriented code allowed, easy utf-8 string manipulation, regexp
support, glib integration, easy access to database, fine tuning support).
I already tested all these features and they are working quite fine.
Yesterday I also created a binding to libstemmer and it was very easy.

Anyway I faced a couple of issues that I was not able to solve:

1) I tried to create a gstreamer plugin following the Gstreamer Plugin
Writer's Guide
(http://gstreamer.freedesktop.org/data/doc/gstreamer/head/pwg/html/index.html).
I was able to create the plugin, but I was not able to create it using
vala alone, because I was not able to insert in the generated C output
this code:

#include <glib.h>
#include <gst/gst.h>
GST_PLUGIN_DEFINE (
     GST_VERSION_MAJOR,
      GST_VERSION_MINOR,
      "my_filter",
      "My filter plugin",
      plugin_init,
      VERSION,
      "LGPL",
      "GStreamer",
      "http://gstreamer.net/";
      )

At last I decided it was not a big issue to put this code in a C file,
but is there any way to directly inject C code in vala?

2) I tried to read a file, one line at time, using the FileStream
object, but I was not able to get the desired result with the current
API, because I needed the whole line (EOL inclusive), while read_line()
removes it. The work around of adding a new line to each line does not
allow to know if the last character of the file was a new line or not.
Is there any way to (easily) read a file including the EOL character?

Thank you very much for your help and work.
Bests,
    Giulio.



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