mirror of https://github.com/mono/CppSharp.git
c-sharpdotnetmonobindingsbridgecclangcpluspluscppsharpglueinteropparserparsingpinvokeswigsyntax-treevisitorsxamarinxamarin-bindings
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
72 lines
1.7 KiB
72 lines
1.7 KiB
using System.Collections.Generic; |
|
|
|
namespace CppSharp.AST |
|
{ |
|
/// <summary> |
|
/// Represents a C++ property. |
|
/// </summary> |
|
public class Property : Declaration, ITypedDecl |
|
{ |
|
public Property() |
|
{ |
|
} |
|
|
|
public Property(Property property) |
|
: base(property) |
|
{ |
|
QualifiedType = property.QualifiedType; |
|
GetMethod = property.GetMethod; |
|
SetMethod = property.SetMethod; |
|
Field = property.Field; |
|
parameters.AddRange(property.Parameters); |
|
} |
|
|
|
public Type Type |
|
{ |
|
get { return QualifiedType.Type; } |
|
} |
|
|
|
public QualifiedType QualifiedType { get; set; } |
|
|
|
public Method GetMethod { get; set; } |
|
|
|
public Method SetMethod { get; set; } |
|
|
|
public bool HasGetter |
|
{ |
|
get |
|
{ |
|
return (GetMethod != null) || (Field != null); |
|
} |
|
} |
|
|
|
public bool HasSetter |
|
{ |
|
get |
|
{ |
|
return (SetMethod != null) || |
|
(Field != null && !Field.QualifiedType.Qualifiers.IsConst); |
|
} |
|
} |
|
|
|
// The field that should be get and set by this property |
|
public Field Field { get; set; } |
|
|
|
public Class ExplicitInterfaceImpl { get; set; } |
|
|
|
private readonly List<Parameter> parameters = new List<Parameter>(); |
|
|
|
/// <summary> |
|
/// Only applicable to index ([]) properties. |
|
/// </summary> |
|
public List<Parameter> Parameters |
|
{ |
|
get { return parameters; } |
|
} |
|
|
|
public override T Visit<T>(IDeclVisitor<T> visitor) |
|
{ |
|
return visitor.VisitProperty(this); |
|
} |
|
} |
|
} |