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
Any CStruct

Constructores

new(str cName, str header, bool isUnion, i32 pack)
#

Métodos

Add(str cName, str type, str typedef) : CStruct
#

Campos

str CName
#
str Name
#
str Namespace
#
str File
#
bool IsUnion
#
i32 Pack
#

C's #pragma pack (0: natural alignment).

List<CField> Fields
#

Miembros heredados (5)

Código fuente

CStruct en Antril, descompilado a partir de su Larva HIR.

System.Bindings.CStruct.ant
// 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;
			}
	}
}
Esc