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

Function getPascalClassParameters

Source/buildbindingpascal.go:694–727  ·  view source on GitHub ↗
(method ComponentDefinitionMethod, NameSpace string, ClassName string, isGlobal bool, isImplementation bool)

Source from the content-addressed store, hash-verified

692}
693
694func getPascalClassParameters(method ComponentDefinitionMethod, NameSpace string, ClassName string, isGlobal bool, isImplementation bool) (string, string, error) {
695 parameters := ""
696 returnType := ""
697
698 for k := 0; k < len(method.Params); k++ {
699 param := method.Params[k]
700 ParamTypeName, err := getPascalParameterType(param.ParamType, NameSpace, param.ParamClass, false, isImplementation)
701 if err != nil {
702 return "", "", err
703 }
704
705 switch param.ParamPass {
706 case "in":
707 if parameters != "" {
708 parameters = parameters + "; "
709 }
710 parameters = parameters + "const A" + param.ParamName + ": " + ParamTypeName
711
712 case "out":
713 if parameters != "" {
714 parameters = parameters + "; "
715 }
716 parameters = parameters + "out A" + param.ParamName + ": " + ParamTypeName
717
718 case "return":
719 if returnType != "" {
720 return "", "", fmt.Errorf("duplicate return value \"%s\" for Pascal method \"%s\"", param.ParamName, method.MethodName)
721 }
722 returnType = ParamTypeName
723 }
724 }
725
726 return parameters, returnType, nil
727}
728
729func writePascalClassMethodDefinition(method ComponentDefinitionMethod, w LanguageWriter, NameSpace string, ClassName string, isGlobal bool, isImplementation bool) error {
730

Calls 1

getPascalParameterTypeFunction · 0.85

Tested by

no test coverage detected