Пример #1
0
def renderDefinitionFile(outputdir, source, definition, definitions):
    with open(os.path.join(outputdir, "%s.h" % definition.name), 'w') as out:
        define = headerDefine("cssom", definition.name, "h")
        print >> out, "#ifndef %s" % define
        print >> out, "#define %s" % define

        renderWarning(out, source)

        renderInclude(out, definition)

        print >> out
        print >> out, "#ifdef __cplusplus"
        print >> out, "extern \"C\" {"
        print >> out, "#endif"

        renderDefinition(out, definition, definitions)

        print >> out
        print >> out
        print >> out
        print >> out, "#ifdef __cplusplus"
        print >> out, "}"
        print >> out, "#endif"
        print >> out
        print >> out, "#endif"
Пример #2
0
def renderDefinitionHeaderFile(outputdir, source, definition, definitions):
    with open(os.path.join(outputdir, "%s.hpp" % definition.name), 'w') as out:
        define = headerDefine("cssompp", definition.name, "hpp")
        print >> out, "#ifndef %s" % define
        print >> out, "#define %s" % define

        renderWarning(out, source)

        renderInclude(out, definition)

        print >> out

        renderForwardDeclarations(out, forwards.get(definition.name, []))

        print >> out
        print >> out, """namespace cssom {"""

        renderDefinition(out, definition, definitions)

        print >> out
        print >> out
        print >> out
        print >> out, "} // cssom"
        print >> out
        print >> out, "#endif // %s" "" % define
Пример #3
0
def renderDefinitionFile(outputdir, source, definition, definitions):
  with open(os.path.join(outputdir, "%s.h" % definition.name), 'w') as out:
    define = headerDefine("cssom", definition.name, "h")
    print >>out, "#ifndef %s" % define
    print >>out, "#define %s" % define

    renderWarning(out, source)

    renderInclude(out, definition)

    print >>out
    print >>out, "#ifdef __cplusplus"
    print >>out, "extern \"C\" {"
    print >>out, "#endif"

    renderDefinition(out, definition, definitions)

    print >>out
    print >>out
    print >>out
    print >>out, "#ifdef __cplusplus"
    print >>out, "}"
    print >>out, "#endif"
    print >>out
    print >>out, "#endif"
Пример #4
0
def renderDefinitionHeaderFile(outputdir, source, definition, definitions):
  with open(os.path.join(outputdir, "%s.hpp" % definition.name), 'w') as out:
    define = headerDefine("cssompp", definition.name, "hpp")
    print >>out, "#ifndef %s" % define
    print >>out, "#define %s" % define

    renderWarning(out, source)

    renderInclude(out, definition)

    print >>out

    renderForwardDeclarations(out, forwards.get(definition.name, []))

    print >>out
    print >>out, """namespace cssom {"""

    renderDefinition(out, definition, definitions)

    print >>out
    print >>out
    print >>out
    print >>out, "} // cssom"
    print >>out
    print >>out, "#endif // %s""" % define  
Пример #5
0
def renderDefinitionSourceFile(outputdir, source, definition, definitions):
  if isinstance(definition, pywidl.Typedef): return

  with open(os.path.join(outputdir, "%s.cpp" % definition.name), 'w') as out:
    print >>out, "#include <cssompp/%s.hpp>" % definition.name

    renderWarning(out, source)

    renderInclude(out, definition)

    print >>out
    print >>out, "#include \"checks.hpp\""
    print >>out
    print >>out, "#include <utility>"
    print >>out
    print >>out, "namespace cssom {"

    renderDefinition(out, definition, definitions)

    print >>out
    print >>out
    print >>out
    print >>out, "} // cssom"