final class · System.Bindings
CType
public final class CType
A C type as the binding writes it (i32, u8*, SDL_Rect*, func*<void*> : i32), and the typedef C wrote it with.
- Tipo
- final class
- Espacio de nombres
- System.Bindings
- Ensamblado
- System.Bindings
- Acceso
- public, final
- Archivo fuente
Model.ant
Herencia
- Clases base
-
AnyCType
Constructores
new(str text, str typedef)
#
Métodos
Whether it is a pointer (T*).
Whether it is a number type (i8 … u64, f32, f64), without pointers.
Campos
str Text
#
The type in the binding (names of structs and enums are their C names until the end: the runner renames them).
str Typedef
#
The C typedef it was written with (SDL_InitFlags), or "".
Miembros heredados (5)
GetTypemétodo de AnyUndescribedmétodo de AnyToStringmétodo de AnyHashmétodo de Anydestroymétodo de Any
Código fuente
CType en Antril, descompilado a partir de su Larva HIR.
// System.Bindings.CType — System.Bindings (decompiled from Larva HIR)
into namespace System.Bindings
{
/// A C type as the binding writes it (`i32`, `u8*`, `SDL_Rect*`, `func*<void*> : i32`), and the typedef C wrote it with.
public final class CType
{
public:
/// The type in the binding (names of structs and enums are their C names until the end: the runner renames them).
str Text;
/// The C typedef it was written with (`SDL_InitFlags`), or "".
str Typedef;
new(str text, str typedef)
{
Text = text;
Typedef = typedef;
}
/// Whether it is a pointer (`T*`).
IsPointer() : bool => Text.EndsWith("*");
/// Whether it is a number type (`i8` … `u64`, `f32`, `f64`), without pointers.
IsNumber() : bool
{
return Text == "i8" || Text == "u8" || Text == "i16" || Text == "u16" || Text == "i32" || Text == "u32" || Text == "i64" || Text == "u64" || Text == "f32" || Text == "f64";
}
}
}