示例#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
示例#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
示例#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