public void generate(ClassNode root, ProxyGenSettings proxyGenSettings)
            throws java.io.IOException {
        if (root.isPrimitive() == true || root.needsProxy() == false) {
            return;
        }

        this.proxyGenSettings = proxyGenSettings;

        String fullFileName = proxyGenSettings.getProject().getCPPOutputDir() + File.separatorChar;
        if (root.getPackageName().equals("") == true) {
            fullFileName = root.getCPPClassName() + "ProxyForward.h";
        } else {
            fullFileName = root.getPackageName().replace('.', File.separatorChar) + File.separatorChar + root.getCPPClassName() + "ProxyForward.h";
        }

        FormattedFileWriter writer = new FormattedFileWriter(fullFileName, true);
        String def = "__" + root.getPackageName().replace('.', '_') + "_" + root.getCPPClassName() + "ProxyForward_H";
        writer.outputLine("#ifndef " + def);
        writer.outputLine("#define " + def);
        writer.newLine(2);

        Iterator it = root.getNamespaceElements();
        while (it.hasNext() == true) {
            String current = (String) it.next();
            writer.outputLine("namespace " + current);
            writer.outputLine("{");
            writer.incTabLevel();
        }

        writer.outputLine("class " + root.getCPPClassName() + "Proxy;");

        for (it = root.getNamespaceElements(); it.hasNext() == true; it.next()) {
            writer.decTabLevel();
            writer.outputLine("}");
        }

        writer.newLine(2);
        writer.outputLine("#endif");
        writer.flush();
        writer.close();
    }