(ParamTypeName string, NameSpace string, ParamClass string, isPlain bool, isImplementation bool)
| 216 | } |
| 217 | |
| 218 | func getPascalParameterType(ParamTypeName string, NameSpace string, ParamClass string, isPlain bool, isImplementation bool) (string, error) { |
| 219 | PascalParamTypeName := "" |
| 220 | switch ParamTypeName { |
| 221 | case "uint8": |
| 222 | PascalParamTypeName = "Byte" |
| 223 | |
| 224 | case "uint16": |
| 225 | PascalParamTypeName = "Word" |
| 226 | |
| 227 | case "uint32": |
| 228 | PascalParamTypeName = "Cardinal" |
| 229 | |
| 230 | case "uint64": |
| 231 | PascalParamTypeName = "QWord" |
| 232 | |
| 233 | case "int8": |
| 234 | PascalParamTypeName = "ShortInt" |
| 235 | |
| 236 | case "int16": |
| 237 | PascalParamTypeName = "SmallInt" |
| 238 | |
| 239 | case "int32": |
| 240 | PascalParamTypeName = "Integer" |
| 241 | |
| 242 | case "int64": |
| 243 | PascalParamTypeName = "Int64" |
| 244 | |
| 245 | case "bool": |
| 246 | if isPlain { |
| 247 | PascalParamTypeName = "Byte" |
| 248 | } else { |
| 249 | PascalParamTypeName = "Boolean" |
| 250 | } |
| 251 | |
| 252 | case "single": |
| 253 | PascalParamTypeName = "Single" |
| 254 | |
| 255 | case "double": |
| 256 | PascalParamTypeName = "Double" |
| 257 | |
| 258 | case "pointer": |
| 259 | PascalParamTypeName = "Pointer" |
| 260 | |
| 261 | case "string": |
| 262 | if isPlain { |
| 263 | PascalParamTypeName = "PAnsiChar" |
| 264 | } else { |
| 265 | PascalParamTypeName = "String" |
| 266 | } |
| 267 | |
| 268 | case "enum": |
| 269 | if isPlain { |
| 270 | PascalParamTypeName = fmt.Sprintf("Integer") |
| 271 | } else { |
| 272 | PascalParamTypeName = fmt.Sprintf("T%s%s", NameSpace, ParamClass) |
| 273 | } |
| 274 | |
| 275 | case "functiontype": |
no test coverage detected