Esempio n. 1
0
def formatCc(bdl: Object) -> str:

    template = Template.fromPath(Path(__file__).parent / "template/file.h.btl",
                                 indent=True)
    output = template.render(bdl.tree, Transform())

    return output
Esempio n. 2
0
def compositionCc(composition: Composition) -> str:

    template = Template.fromPath(Path(__file__).parent /
                                 "template/composition.cc.btl",
                                 indent=True)
    output = template.render(composition, Transform(composition))

    return output
Esempio n. 3
0
def formatBdl(bdl: Object) -> str:

    template = Template.fromPath(Path(__file__).parent /
                                 "template/file.bdl.btl",
                                 indent=True)
    output = template.render(
        bdl.tree, {
            "typeToStr": _typeToStr,
            "namespaceToStr": _namespaceToStr,
            "inlineComment": _inlineComment,
            "normalComment": _normalComment,
            "inheritanceToStr": _inheritanceToStr
        })

    return output