final class · System.Bindings
CStruct
public final class CStruct
A C struct (or union) with its layout: a value type of the binding.
- Tipo
- final class
- Espacio de nombres
- System.Bindings
- Ensamblado
- System.Bindings
- Acceso
- public, final
- Archivo fuente
Model.ant
Herencia
- Clases base
-
AnyCStruct
Constructores
Métodos
Campos
str CName
#
str Name
#
str Header
#
str Namespace
#
str File
#
C's #pragma pack (0: natural alignment).
Miembros heredados (5)
GetTypemétodo de AnyUndescribedmétodo de AnyToStringmétodo de AnyHashmétodo de Anydestroymétodo de Any
Código fuente
CStruct en Antril, descompilado a partir de su Larva HIR.
// System.Bindings.CStruct — System.Bindings (decompiled from Larva HIR)
import System;
into namespace System.Bindings
{
/// A C struct (or union) with its layout: a value type of the binding.
public final class CStruct
{
public:
str CName;
str Name;
str Header;
str Namespace;
str File;
bool IsUnion;
/// C's `#pragma pack` (0: natural alignment).
i32 Pack;
List<CField> Fields;
new(str cName, str header, bool isUnion, i32 pack)
{
Namespace = "";
File = "";
Fields = new List<CField>();
CName = cName;
Name = cName;
Header = header;
IsUnion = isUnion;
Pack = pack;
}
Add(str cName, str type, str typedef) : CStruct
{
Fields.Add(new CField(cName, new CType(type, typedef)));
return this;
}
}
}