diff options
Diffstat (limited to 'cpp/src/slice2cpp/Main.cpp')
-rw-r--r-- | cpp/src/slice2cpp/Main.cpp | 26 |
1 files changed, 18 insertions, 8 deletions
diff --git a/cpp/src/slice2cpp/Main.cpp b/cpp/src/slice2cpp/Main.cpp index 25e7038ee8e..27376433b57 100644 --- a/cpp/src/slice2cpp/Main.cpp +++ b/cpp/src/slice2cpp/Main.cpp @@ -73,7 +73,8 @@ usage(const string& n) "--include-dir DIR Use DIR as the header include directory in source files.\n" "--output-dir DIR Create files in the directory DIR.\n" "--dll-export SYMBOL Use SYMBOL for DLL exports.\n" - "--impl Generate sample implementations.\n" + "--impl-c++98 Generate sample implementations for C++98 mapping.\n" + "--impl-c++11 Generate sample implementations for C++11 mapping.\n" "--depend Generate Makefile dependencies.\n" "--depend-xml Generate dependencies in XML format.\n" "--depend-file FILE Write dependencies to FILE instead of standard output.\n" @@ -81,7 +82,6 @@ usage(const string& n) "--ice Allow reserved Ice prefix in Slice identifiers.\n" "--underscore Allow underscores in Slice identifiers.\n" "--checksum Generate checksums for Slice definitions.\n" - "--stream Generate marshaling support for public stream API.\n" ; } @@ -102,7 +102,8 @@ compile(const vector<string>& argv) opts.addOpt("", "include-dir", IceUtilInternal::Options::NeedArg); opts.addOpt("", "output-dir", IceUtilInternal::Options::NeedArg); opts.addOpt("", "dll-export", IceUtilInternal::Options::NeedArg); - opts.addOpt("", "impl"); + opts.addOpt("", "impl-c++98"); + opts.addOpt("", "impl-c++11"); opts.addOpt("", "depend"); opts.addOpt("", "depend-xml"); opts.addOpt("", "depend-file", IceUtilInternal::Options::NeedArg, ""); @@ -110,7 +111,6 @@ compile(const vector<string>& argv) opts.addOpt("", "ice"); opts.addOpt("", "underscore"); opts.addOpt("", "checksum"); - opts.addOpt("", "stream"); bool validate = find(argv.begin(), argv.end(), "--validate") != argv.end(); vector<string> args; @@ -173,7 +173,9 @@ compile(const vector<string>& argv) string dllExport = opts.optArg("dll-export"); - bool impl = opts.isSet("impl"); + bool implCpp98 = opts.isSet("impl-c++98"); + + bool implCpp11 = opts.isSet("impl-c++11"); bool depend = opts.isSet("depend"); @@ -189,8 +191,6 @@ compile(const vector<string>& argv) bool checksum = opts.isSet("checksum"); - bool stream = opts.isSet("stream"); - if(args.empty()) { getErrorStream() << argv[0] << ": error: no input file" << endl; @@ -210,6 +210,16 @@ compile(const vector<string>& argv) } return EXIT_FAILURE; } + + if(implCpp98 && implCpp11) + { + getErrorStream() << argv[0] << ": error: cannot specify both --impl-c++98 and --impl-c++11" << endl; + if(!validate) + { + usage(argv[0]); + } + return EXIT_FAILURE; + } if(validate) { @@ -317,7 +327,7 @@ compile(const vector<string>& argv) try { Gen gen(icecpp->getBaseName(), headerExtension, sourceExtension, extraHeaders, include, - includePaths, dllExport, output, impl, checksum, stream, ice); + includePaths, dllExport, output, implCpp98, implCpp11, checksum, ice); gen.generate(u); } catch(const Slice::FileException& ex) |