clibgen.api.EnumDefinition
R2026bDescription
A clibgen.api.EnumDefinition object represents the MATLAB® definition of a C++ enumeration.
Creation
creates an enumeration
definition object from the enumDef = idef.EnumsEnums property of a clibgen.api.InterfaceDefinition
object.
Properties
This property is read-only.
Fully qualified C++ enumeration name, represented as a string scalar.
MATLAB name of the C++ enumeration, specified as a string scalar.
This property is read-only.
Array of enumerations, represented as a string vector.
Whether this construct is included in the interface, specified as a numeric or logical
1 (true) or 0
(false).
Doxygen @brief comments for the enumeration, specified as a
string scalar. The default text is:
MATLABName Representation of C++ enumeration CPPName.
You can modify the description in the EnumDefinition object.
Doxygen @details comments for the enumeration from the header
file, specified as a string scalar. If the C++ file does not contain a comment about the
enumeration, then DetailedDescription is empty and does not appear
in the definition file.
If DetailedDescription is not empty, then the MATLAB
doc command displays the following sentence before displaying the value
of DetailedDescription:
This content is from the external library documentation.
Use the DetailedDescription property to provide more information about
the interface definition file.
Examples
Use clibgen.api.EnumDefinition objects to inspect,
rename, and exclude C++ enumerations from a MATLAB interface.
Configure the interface for a library defined by
colorlib.hpp.
icfg = clibgen.api.InterfaceConfiguration("colorlib",HeaderFiles="colorlib.hpp"); idef = clibgen.api.InterfaceDefinition(icfg);
Use the InterfaceDefinition.Enums object to list all of the
enumeration definitions.
idef.Enums
ans =
1×3 EnumDefinition array with properties:
CPPName
MATLABName
Included
Display as tableIf there are multiple enumerations, click the Display as table
link.
idef.Enums
CPPName MATLABName Included
_____________________ __________________________________ ________
"graphics::Color" "clib.colorlib.graphics.Color" true
"graphics::LineStyle" "clib.colorlib.LineStyle" true
"graphics::BlendMode" "clib.colorlib.graphics.BlendMode" true
The EnumDefinition object exposes C++ and MATLAB metadata.
enumDef = idef.findEnum("graphics::Color")enumDef =
EnumDefinition with properties:
CPPName: "graphics::Color"
MATLABName: "clib.colorlib.graphics.Color"
Included: true
Show all propertiesTo change the MATLAB-visible name for enumDef, set
MATLABName.
enumDef = idef.findEnum("graphics::LineStyle"); enumDef.MATLABName = "clib.colorlib.LineStyle"
enumDef =
EnumDefinition with properties:
CPPName: "graphics::LineStyle"
MATLABName: "clib.colorlib.LineStyle"
Included: true
Show all properties
To exclude the enumeration, set Included to
false.
enumDef = idef.findEnum("graphics::BlendMode");
enumDef.Included = false;
enumDefenumDef =
EnumDefinition with properties:
CPPName: "graphics::BlendMode"
MATLABName: "clib.colorlib.graphics.BlendMode"
Included: false
Show all propertiesVersion History
Introduced in R2026b
MATLAB Command
You clicked a link that corresponds to this MATLAB command:
Run the command by entering it in the MATLAB Command Window. Web browsers do not support MATLAB commands.
Sélectionner un site web
Choisissez un site web pour accéder au contenu traduit dans votre langue (lorsqu'il est disponible) et voir les événements et les offres locales. D’après votre position, nous vous recommandons de sélectionner la région suivante : .
Vous pouvez également sélectionner un site web dans la liste suivante :
Comment optimiser les performances du site
Pour optimiser les performances du site, sélectionnez la région Chine (en chinois ou en anglais). Les sites de MathWorks pour les autres pays ne sont pas optimisés pour les visites provenant de votre région.
Amériques
- América Latina (Español)
- Canada (English)
- United States (English)
Europe
- Belgium (English)
- Denmark (English)
- Deutschland (Deutsch)
- España (Español)
- Finland (English)
- France (Français)
- Ireland (English)
- Italia (Italiano)
- Luxembourg (English)
- Netherlands (English)
- Norway (English)
- Österreich (Deutsch)
- Portugal (English)
- Sweden (English)
- Switzerland
- United Kingdom (English)