MCPcopy Create free account
hub / github.com/Autodesk/AutomaticComponentToolkit / buildGoEnums

Function buildGoEnums

Source/buildbindinggo.go:149–175  ·  view source on GitHub ↗
(component ComponentDefinition, w LanguageWriter)

Source from the content-addressed store, hash-verified

147
148
149func buildGoEnums(component ComponentDefinition, w LanguageWriter) {
150 if len(component.Enums) <= 0 {
151 return
152 }
153 NameSpace := component.NameSpace
154
155 w.Writeln("")
156 w.Writeln("/*************************************************************************************************************************")
157 w.Writeln(" Declaration of enums")
158 w.Writeln("**************************************************************************************************************************/")
159 w.Writeln("")
160 for i := 0; i < len(component.Enums); i++ {
161 enum := component.Enums[i]
162 w.Writeln("type E%s%s int", NameSpace, enum.Name)
163
164 w.Writeln("const (")
165
166 for j := 0; j < len(enum.Options); j++ {
167
168 option := enum.Options[j]
169 w.Writeln(" e%s_%s = %d", enum.Name, option.Name, option.Value)
170 }
171 w.Writeln(")")
172 w.Writeln("")
173 }
174 w.Writeln("")
175}
176
177func buildGoStructs(component ComponentDefinition, w LanguageWriter) (error) {
178 if len(component.Structs) <= 0 {

Callers 1

buildGoWrapperFunction · 0.85

Calls 1

WritelnMethod · 0.80

Tested by

no test coverage detected