Exemple #1
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
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  
def renderInclude(out, definition):
  print >>out
  print >>out, "#include <cssom/%s.h>" % definition.name

  hppincludes = forwards.get(definition.name, [])

  if hppincludes: print >>out
  for include in hppincludes:
    print >>out, "#include <cssompp/%s.hpp>" % include