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

Constructors

new(str cName, str header, str underlying, bool isFlags)
#

Methods

Add(str cName, i64 value) : CEnum
#
Typedef(str typedef) : CEnum
#

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 Namespace
#
str File
#
str Underlying
#

Its number type (i32, u32…).

bool IsFlags
#
List<CEnumMember> Members
#
List<str> Typedefs
#

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)

Source

CEnum as Antril, decompiled from its Larva HIR.

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