Package de.netallied.xsd2cppsax

Examples of de.netallied.xsd2cppsax.Config


     */
    public static void printCtorDtorImpl(PrintStream stream, String className, String baseClass, boolean initMaps,
            boolean errHandler, IGenerationDataProvider dataProvoider, String ctorParas,
            List<String> initializationList, String ctorTmpl, String dtorTmpl) {

        Config config = dataProvoider.getConfig();

        // c-tor
        stream.println(config.getOutputSourceFileMethodDelimiter());
        stream.print(className + "::" + className + "(");
        if (ctorParas != null) {
            stream.print(" " + ctorParas);
            if (errHandler) {
                stream.print(",");
            } else {
                stream.print(" ");
            }
        }
        if (errHandler) {
            stream.print(" " + config.getNamespace() + "::" + config.getClassNamePublic() + "* impl, "
                    + config.getBaseClassNamespace() + "::");
            stream.println("IErrorHandler* errorHandler ");
        }
        stream.print(")");
        if (errHandler) {
            stream.print(config.getIndentation());
            stream.println(": " + config.getBaseClassNamespace() + "::" + baseClass + "(impl, errorHandler)");
        } else {
            stream.println();
        }

        if (initializationList != null && !initializationList.isEmpty()) {
            stream.print(config.getIndentation());
            if (!errHandler) {
                stream.print(": ");
            } else {
                stream.print(", ");
            }
            stream.println(initializationList.get(0));
            for (int i = 1; i < initializationList.size(); i++) {
                stream.print(config.getIndentation());
                stream.print(", ");
                stream.println(initializationList.get(i));
            }
        }

        stream.println("{");

        if (initMaps) {
            stream.print(config.getIndentation());
            stream.println(createInitFunctionMapMethodName() + "();");
            stream.print(config.getIndentation());
            stream.println(createInitNameMapMethodName() + "();");
        }
        if (ctorTmpl != null) {
            stream.println(TemplateEngine.fillInTemplate(ctorTmpl, null, null, null, null, null, null, dataProvoider));
        }
        stream.println("}");
        stream.println();

        // d-tor
        stream.println(config.getOutputSourceFileMethodDelimiter());
        stream.println(className + "::~" + className + "()");
        stream.println("{");
        if (dtorTmpl != null) {
            stream.println(TemplateEngine.fillInTemplate(dtorTmpl, null, null, null, null, null, null, dataProvoider));
        }
View Full Code Here


     *            {@link IGenerationDataProvider} to be used by
     *            {@link ICodePrinter}s.
     * @return List of {@link ICodePrinter}s.
     */
    public static List<ICodePrinter> createCodePrinters(IGenerationDataProvider dataProvider) {
        Config config = dataProvider.getConfig();
        List<ICodePrinter> printers = new ArrayList<ICodePrinter>();
        if (config.getGenerateExampleParser()) {
            printers.add(new ExampleParserPrinter(dataProvider));
        }
        if (config.getGenerateFprintfParser()) {
            printers.add(new FPrintfParserPrinter(dataProvider));
        }
        if (config.getGenerateCoherencyTestParser()) {
            printers.add(new SaxCoherencyTest14ParserPrinter(dataProvider));
        }
        return printers;
    }
View Full Code Here

TOP

Related Classes of de.netallied.xsd2cppsax.Config

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.