Re: [Vala] How to assign to construct-only property?



InflateGZip inherits from Gsf.InputGZip, but an error occurred.

gsf-decompress.vala:6.9-6.20: error: chain up to `Gsf.InputGZip.new' not
supported

if uncomment Object(raw: true),

gsf-decompress.vala:6.9-6.20: error: Multiple constructor calls in the same
constructor are not permitted

Is there no way to set construct-only property in Vala ?

class InflateGZip : Gsf.InputGZip
{
    public InflateGZip(Gsf.Input source)
    {
        //Object(raw: true);
        base(source);
    }
}

void main (string[] args)
{
    ...
    var stream = new InflateGZip (input);
}




2012/11/21 Hodong Kim <cogniti gmail com>

Hello,

I want to set "raw" property in Gsf.InputGZip.
Should I inherit Gsf.InputGZip ?

--------

void main (string[] args)
{
    Gsf.InfileMSOle olefile;

    string filename = args[1];

    try   {
        var file = new Gsf.InputStdio (filename);
        olefile  = new Gsf.InfileMSOle (file);
    }
    catch {
        stderr.printf ("%s is not a OLE file\n", filename);
        return;
    }

    var input = olefile.child_by_name("DocInfo");

    // HERE, How to assign to construct-only property?
    var stream = new Gsf.InputGZip(input);
}

--------


Reference:

http://www.valadoc.org/#!api=libgsf-1/Gsf.InputGZip
    public bool raw { construct set; get; }

http://projects.gnome.org/libgsf/gsf-Compression.html#gsf-input-gzip-new
    "raw"    gboolean    : Read / Write / Construct Only
    Whether to read compressed data with no header and no trailer.
    Default value: FALSE


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