final class · System.Bindings
CEnum
public final class CEnum
An enum (or bitflag enum): from a C enum, or made from constants (BindingModel.Enum).
- Tipo
- final class
- Espacio de nombres
- System.Bindings
- Ensamblado
- System.Bindings
- Acceso
- public, final
- Archivo fuente
Model.ant
Herencia
- Clases base
-
AnyCEnum
Constructores
Métodos
Takes a typedef: what C wrote with it takes this enum.
Campos
str CName
#
Its C name (the C enum's, or the name a profile gave it).
str Name
#
str Header
#
str Namespace
#
str File
#
str Underlying
#
Its number type (i32, u32…).
List<CEnumMember> Members
#
C typedefs whose parameters, results and fields take this enum (SDL_InitFlags).
str MemberPrefix
#
The prefix its members lose ("": the one they share, when the settings say so).
Miembros heredados (5)
GetTypemétodo de AnyUndescribedmétodo de AnyToStringmétodo de AnyHashmétodo de Anydestroymétodo de Any
Código fuente
CEnum en Antril, descompilado a partir de su Larva HIR.
// System.Bindings.CEnum — System.Bindings (decompiled from Larva HIR)
import System;
into namespace System.Bindings
{
/// An enum (or bitflag enum): from a C enum, or made from constants (`BindingModel.Enum`).
public final class CEnum
{
public:
/// Its C name (the C enum's, or the name a profile gave it).
str CName;
str Name;
str Header;
str Namespace;
str File;
/// Its number type (`i32`, `u32`…).
str Underlying;
bool IsFlags;
List<CEnumMember> Members;
/// C typedefs whose parameters, results and fields take this enum (`SDL_InitFlags`).
List<str> Typedefs;
/// The prefix its members lose ("": the one they share, when the settings say so).
str MemberPrefix;
new(str cName, str header, str underlying, bool isFlags)
{
Namespace = "";
File = "";
Members = new List<CEnumMember>();
Typedefs = new List<str>();
MemberPrefix = "";
CName = cName;
Name = cName;
Header = header;
Underlying = underlying;
IsFlags = isFlags;
}
Add(str cName, i64 value) : CEnum
{
Members.Add(new CEnumMember(cName, value));
return this;
}
/// Takes a typedef: what C wrote with it takes this enum.
Typedef(str typedef) : CEnum
{
Typedefs.Add(typedef);
return this;
}
}
}