Re: [Vala] Replacing "void method ( out Type)" with "Type method()"
- From: Adi Roiban <adi roiban ro>
- To: vala-list gnome org
- Subject: Re: [Vala] Replacing "void method ( out Type)" with "Type method()"
- Date: Thu, 12 Mar 2009 02:04:02 +0200
Hi,
În data de Jo, 12-03-2009 la 00:47 +0100, Frederik a scris:
Adi Roiban wrote:
Maybe there is a way to write small functions inside a VAPI file for
helping VALA with the code generation.
That's possible: have a look at string.substring(), .contains(),
.replace() and .length in 'glib-2.0.vapi' for example.
Thanks for you help!
I was able to do this :
public void to_time (out Time tm);
public Time toTime () {
Time time;
to_time ( out time );
return time;
}
public Date.now () {
clear();
Time timeNow = Time.gm( time_t() );
set_year( (GLib.DateYear)(timeNow.year + 1900) );
set_month( (GLib.DateMonth)(timeNow.month + 1) );
set_day( (GLib.DateDay)(timeNow.day) + 1);
}
public string to_string () {
Time time;
to_time ( out time);
return time.to_string();
}
But when doing the same trick to GLib.Time i got
public Time.gm.now () {
Time.gm(time_t());
}
public Time.local.now () {
Time.local(time_t());
}
glib-2.0.vapi:1857.3-1857.20: error: missing return type in method
`Time.gm´
public Time.gm.now () {
^^^^^^^^^^^^^^^^^^
glib-2.0.vapi:1861.3-1861.23: error: missing return type in method
`Time.local´
public Time.local.now () {
I don't know exactly how the VAPI code fits , how to use a contstructor,
do I have access to "this" ...
Many thanks!
--
Adi Roiban
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]