Beispiel #1
0
def generate_interface_example(config, interfaceName):
    """
    |config| Is the configuration object.
    |interfaceName| is the name of the interface we're generating an example for.
    """

    root = CGExampleRoot(config, interfaceName)
    exampleHeader = interfaceName + "-example.h"
    exampleImpl = interfaceName + "-example.cpp"
    replaceFileIfChanged(exampleHeader, root.declare())
    replaceFileIfChanged(exampleImpl, root.define())
def generate_interface_example(config, interfaceName):
    """
    |config| Is the configuration object.
    |interfaceName| is the name of the interface we're generating an example for.
    """

    root = CGExampleRoot(config, interfaceName)
    exampleHeader = interfaceName + "-example.h"
    exampleImpl = interfaceName + "-example.cpp"
    replaceFileIfChanged(exampleHeader, root.declare())
    replaceFileIfChanged(exampleImpl, root.define())
Beispiel #3
0
    def generate_example_files(self, interface):
        """Generates example files for a given interface."""
        from Codegen import CGExampleRoot

        root = CGExampleRoot(self.config, interface)

        return self._maybe_write_codegen(root, *self._example_paths(interface))
Beispiel #4
0
    def generate_example_files(self, interface):
        """Generates example files for a given interface."""
        from Codegen import CGExampleRoot

        root = CGExampleRoot(self.config, interface)

        example_paths = self._example_paths(interface)
        for path in example_paths:
            print "Generating %s" % path

        return self._maybe_write_codegen(root, *example_paths)