final class · System.Bindings
CEnum
public final class CEnum
An enum (or bitflag enum): from a C enum, or made from constants (BindingModel.Enum).
- Kind
- final class
- Namespace
- System.Bindings
- Assembly
- System.Bindings
- Access
- public, final
- Source file
Model.ant
Inheritance
- Base classes
-
AnyCEnum
Constructors
Methods
Takes a typedef: what C wrote with it takes this enum.
Fields
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).
Inherited members (5)
GetTypemethod from AnyUndescribedmethod from AnyToStringmethod from AnyHashmethod from Anydestroymethod from Any
Source
CEnum as Antril, decompiled from its 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;
}
}
}