libvaladoc: Replace void* with corresponding Vala API
[vala-gnome.git] / libvaladoc / api / constant.vala
blobd9d3f475d424e485cf4a9ee44f92806f01a40a87
1 /* constant.vala
3 * Copyright (C) 2008-2011 Florian Brosch
5 * This library is free software; you can redistribute it and/or
6 * modify it under the terms of the GNU Lesser General Public
7 * License as published by the Free Software Foundation; either
8 * version 2.1 of the License, or (at your option) any later version.
10 * This library is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 * Lesser General Public License for more details.
15 * You should have received a copy of the GNU Lesser General Public
16 * License along with this library; if not, write to the Free Software
17 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
19 * Author:
20 * Florian Brosch <flo.brosch@gmail.com>
24 using Valadoc.Content;
26 /**
27 * Represents a type member with a constant value.
29 public class Valadoc.Api.Constant : Member {
30 private string? cname;
32 /**
33 * The data type of this constant.
35 public TypeReference constant_type {
36 set;
37 get;
40 public Constant (Node parent, SourceFile file, string name, SymbolAccessibility accessibility,
41 SourceComment? comment, string? cname, Vala.Constant data)
43 base (parent, file, name, accessibility, comment, data);
45 this.cname = cname;
48 /**
49 * Returns the name of this constant as it is used in C.
51 public string get_cname () {
52 return cname;
55 /**
56 * {@inheritDoc}
58 protected override Inline build_signature () {
59 return new SignatureBuilder ()
60 .append_keyword (accessibility.to_string ())
61 .append_keyword ("const")
62 .append_content (constant_type.signature)
63 .append_symbol (this)
64 .get ();
67 /**
68 * {@inheritDoc}
70 public override NodeType node_type {
71 get { return NodeType.CONSTANT; }
74 /**
75 * {@inheritDoc}
77 public override void accept (Visitor visitor) {
78 visitor.visit_constant (this);