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.
47 lines
1.1 KiB
47 lines
1.1 KiB
namespace CppSharp.AST |
|
{ |
|
/// <summary> |
|
/// Represents a a C/C++ record field Decl. |
|
/// </summary> |
|
public class Field : Declaration, ITypedDecl |
|
{ |
|
public Type Type { get { return QualifiedType.Type; } } |
|
public QualifiedType QualifiedType { get; set; } |
|
|
|
public uint Offset { get; set; } |
|
public Class Class { get; set; } |
|
|
|
public uint OffsetInBytes |
|
{ |
|
get { return Offset / (sizeof (byte) * 8); } |
|
} |
|
|
|
public Expression Expression { get; set; } |
|
|
|
public Field() |
|
{ |
|
Offset = 0; |
|
} |
|
|
|
public Field(string name, QualifiedType type, AccessSpecifier access) |
|
{ |
|
Name = name; |
|
QualifiedType = type; |
|
Access = access; |
|
Offset = 0; |
|
} |
|
|
|
public Field(Field field): base(field) |
|
{ |
|
QualifiedType = field.QualifiedType; |
|
Offset = field.Offset; |
|
Class = field.Class; |
|
Expression = field.Expression; |
|
} |
|
|
|
public override T Visit<T>(IDeclVisitor<T> visitor) |
|
{ |
|
return visitor.VisitFieldDecl(this); |
|
} |
|
} |
|
} |