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

Function getIndentationString

Source/componentdefinition.go:339–360  ·  view source on GitHub ↗
(str string)

Source from the content-addressed store, hash-verified

337}
338
339func getIndentationString(str string) string {
340 if str == "tabs" {
341 return "\t";
342 }
343 index := strings.Index(str, "spaces");
344 if (index < 1) {
345 log.Printf ("invalid indentation: \"%s\". Using \"tabs\" instead\n", str);
346 return "\t";
347 }
348 numSpaces, err := strconv.ParseUint(str[0:index], 10, 64);
349 if err!=nil {
350 log.Printf ("invalid indentation: \"%s\". Using \"4spaces\" instead\n", str);
351 return " ";
352 }
353 indentString := "";
354 var i uint64;
355 for i < numSpaces {
356 indentString = indentString + " ";
357 i++;
358 }
359 return indentString;
360}
361
362func (component *ComponentDefinition) checkImplementations() error {
363 implementations := component.ImplementationList.Implementations

Callers 3

createComponentFunction · 0.85
BuildImplementationCPPFunction · 0.85

Calls 1

PrintfMethod · 0.80

Tested by

no test coverage detected