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.
웹사이트 선택
번역된 콘텐츠를 보고 지역별 이벤트와 혜택을 살펴보려면 웹사이트를 선택하십시오. 현재 계신 지역에 따라 다음 웹사이트를 권장합니다:
또한 다음 목록에서 웹사이트를 선택하실 수도 있습니다.
사이트 성능 최적화 방법
최고의 사이트 성능을 위해 중국 사이트(중국어 또는 영어)를 선택하십시오. 현재 계신 지역에서는 다른 국가의 MathWorks 사이트 방문이 최적화되지 않았습니다.
미주
- América Latina (Español)
- Canada (English)
- United States (English)
유럽
- 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)