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.
- Kind
- final class
- Namespace
- System.Bindings
- Assembly
- System.Bindings
- Access
- public, final
- Source file
Model.ant
Inheritance
- Base classes
-
AnyCType
Constructors
new(str text, str typedef)
#
Methods
Whether it is a pointer (T*).
Whether it is a number type (i8 … u64, f32, f64), without pointers.
Fields
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 "".
Inherited members (5)
GetTypemethod from AnyUndescribedmethod from AnyToStringmethod from AnyHashmethod from Anydestroymethod from Any
Source
CType as Antril, decompiled from its 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";
}
}
}