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
20 * Florian Brosch <flo.brosch@gmail.com>
24 using Valadoc
.Content
;
27 * Represents a type member with a constant value.
29 public class Valadoc
.Api
.Constant
: Member
{
30 private string? cname
;
33 * The data type of this constant.
35 public TypeReference constant_type
{
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
);
49 * Returns the name of this constant as it is used in C.
51 public string get_cname () {
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
)
70 public override NodeType node_type
{
71 get { return NodeType
.CONSTANT
; }
77 public override void accept (Visitor visitor
) {
78 visitor
.visit_constant (this
);