diff options
Diffstat (limited to 'cpp/src/slice2vb/Main.cpp')
-rw-r--r-- | cpp/src/slice2vb/Main.cpp | 170 |
1 files changed, 85 insertions, 85 deletions
diff --git a/cpp/src/slice2vb/Main.cpp b/cpp/src/slice2vb/Main.cpp index 767b93257b2..e16990e3c3a 100644 --- a/cpp/src/slice2vb/Main.cpp +++ b/cpp/src/slice2vb/Main.cpp @@ -31,7 +31,7 @@ usage(const char* n) "--tie Generate TIE classes.\n" "--impl Generate sample implementations.\n" "--impl-tie Generate sample TIE implementations.\n" - "--depend Generate Makefile dependencies.\n" + "--depend Generate Makefile dependencies.\n" "-d, --debug Print debug messages.\n" "--ice Permit `Ice' prefix (for building Ice source code only)\n" "--checksum Generate checksums for Slice definitions.\n" @@ -69,20 +69,20 @@ main(int argc, char* argv[]) catch(const IceUtil::BadOptException& e) { cerr << argv[0] << ": " << e.reason << endl; - usage(argv[0]); - return EXIT_FAILURE; + usage(argv[0]); + return EXIT_FAILURE; } if(opts.isSet("help")) { - usage(argv[0]); - return EXIT_SUCCESS; + usage(argv[0]); + return EXIT_SUCCESS; } if(opts.isSet("version")) { - cout << ICE_STRING_VERSION << endl; - return EXIT_SUCCESS; + cout << ICE_STRING_VERSION << endl; + return EXIT_SUCCESS; } string cppArgs; @@ -90,19 +90,19 @@ main(int argc, char* argv[]) vector<string>::const_iterator i; for(i = optargs.begin(); i != optargs.end(); ++i) { - cppArgs += " -D" + Preprocessor::addQuotes(*i); + cppArgs += " -D" + Preprocessor::addQuotes(*i); } optargs = opts.argVec("U"); for(i = optargs.begin(); i != optargs.end(); ++i) { - cppArgs += " -U" + Preprocessor::addQuotes(*i); + cppArgs += " -U" + Preprocessor::addQuotes(*i); } vector<string> includePaths = opts.argVec("I"); for(i = includePaths.begin(); i != includePaths.end(); ++i) { - cppArgs += " -I" + Preprocessor::addQuotes(*i); + cppArgs += " -I" + Preprocessor::addQuotes(*i); } bool preprocess = opts.isSet("E"); @@ -145,81 +145,81 @@ main(int argc, char* argv[]) for(i = args.begin(); i != args.end(); ++i) { - if(depend) - { - Preprocessor icecpp(argv[0], *i, cppArgs); - icecpp.printMakefileDependencies(Preprocessor::VisualBasic); - } - else - { - Preprocessor icecpp(argv[0], *i, cppArgs); - FILE* cppHandle = icecpp.preprocess(false); - - if(cppHandle == 0) - { - return EXIT_FAILURE; - } - - if(preprocess) - { - char buf[4096]; - while(fgets(buf, static_cast<int>(sizeof(buf)), cppHandle) != NULL) - { - if(fputs(buf, stdout) == EOF) - { - return EXIT_FAILURE; - } - } - if(!icecpp.close()) - { - return EXIT_FAILURE; - } - } - else - { - UnitPtr p = Unit::createUnit(false, false, ice, caseSensitive); - int parseStatus = p->parse(cppHandle, debug); - - if(!icecpp.close()) - { - p->destroy(); - return EXIT_FAILURE; - } - - if(parseStatus == EXIT_FAILURE) - { - status = EXIT_FAILURE; - } - else - { - Gen gen(argv[0], icecpp.getBaseName(), includePaths, output, impl, implTie, stream); - if(!gen) - { - p->destroy(); - return EXIT_FAILURE; - } - gen.generate(p); - if(tie) - { - gen.generateTie(p); - } - if(impl) - { - gen.generateImpl(p); - } - if(implTie) - { - gen.generateImplTie(p); - } - if(checksum) - { - gen.generateChecksums(p); - } - } - - p->destroy(); - } - } + if(depend) + { + Preprocessor icecpp(argv[0], *i, cppArgs); + icecpp.printMakefileDependencies(Preprocessor::VisualBasic); + } + else + { + Preprocessor icecpp(argv[0], *i, cppArgs); + FILE* cppHandle = icecpp.preprocess(false); + + if(cppHandle == 0) + { + return EXIT_FAILURE; + } + + if(preprocess) + { + char buf[4096]; + while(fgets(buf, static_cast<int>(sizeof(buf)), cppHandle) != NULL) + { + if(fputs(buf, stdout) == EOF) + { + return EXIT_FAILURE; + } + } + if(!icecpp.close()) + { + return EXIT_FAILURE; + } + } + else + { + UnitPtr p = Unit::createUnit(false, false, ice, caseSensitive); + int parseStatus = p->parse(cppHandle, debug); + + if(!icecpp.close()) + { + p->destroy(); + return EXIT_FAILURE; + } + + if(parseStatus == EXIT_FAILURE) + { + status = EXIT_FAILURE; + } + else + { + Gen gen(argv[0], icecpp.getBaseName(), includePaths, output, impl, implTie, stream); + if(!gen) + { + p->destroy(); + return EXIT_FAILURE; + } + gen.generate(p); + if(tie) + { + gen.generateTie(p); + } + if(impl) + { + gen.generateImpl(p); + } + if(implTie) + { + gen.generateImplTie(p); + } + if(checksum) + { + gen.generateChecksums(p); + } + } + + p->destroy(); + } + } } return status; |