summaryrefslogtreecommitdiff
path: root/cpp/src/slice2cs/Main.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'cpp/src/slice2cs/Main.cpp')
-rw-r--r--cpp/src/slice2cs/Main.cpp170
1 files changed, 85 insertions, 85 deletions
diff --git a/cpp/src/slice2cs/Main.cpp b/cpp/src/slice2cs/Main.cpp
index fe5118175a0..a34d32301cb 100644
--- a/cpp/src/slice2cs/Main.cpp
+++ b/cpp/src/slice2cs/Main.cpp
@@ -26,12 +26,12 @@ usage(const char* n)
"-DNAME=DEF Define NAME as DEF.\n"
"-UNAME Remove any definition for NAME.\n"
"-IDIR Put DIR in the include file search path.\n"
- "-E Print preprocessor output on stdout.\n"
+ "-E Print preprocessor output on stdout.\n"
"--output-dir DIR Create files in the directory DIR.\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,80 +145,80 @@ main(int argc, char* argv[])
for(i = args.begin(); i != args.end(); ++i)
{
- if(depend)
- {
- Preprocessor icecpp(argv[0], *i, cppArgs);
- icecpp.printMakefileDependencies(Preprocessor::CSharp);
- }
- 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::CSharp);
+ }
+ 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;