summaryrefslogtreecommitdiff
path: root/cpp/src/slice2cpp/Main.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'cpp/src/slice2cpp/Main.cpp')
-rw-r--r--cpp/src/slice2cpp/Main.cpp37
1 files changed, 25 insertions, 12 deletions
diff --git a/cpp/src/slice2cpp/Main.cpp b/cpp/src/slice2cpp/Main.cpp
index 25e7038ee8e..72a549b454e 100644
--- a/cpp/src/slice2cpp/Main.cpp
+++ b/cpp/src/slice2cpp/Main.cpp
@@ -72,16 +72,19 @@ usage(const string& n)
"-E Print preprocessor output on stdout.\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"
+ "--checksum Generate checksums for Slice definitions.\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"
"-d, --debug Print debug messages.\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"
+ "--dll-export SYMBOL Use SYMBOL for DLL exports\n"
+ " deprecated: use instead [[\"cpp:dll-export:SYMBOL\"]] metadata.\n"
+ "--ice Allow reserved Ice prefix in Slice identifiers\n"
+ " deprecated: use instead [[\"ice-prefix\"]] metadata.\n"
+ "--underscore Allow underscores in Slice identifiers\n"
+ " deprecated: use instead [[\"underscore\"]] metadata.\n"
;
}
@@ -102,7 +105,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 +114,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 +176,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 +194,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;
@@ -211,6 +214,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)
{
return EXIT_SUCCESS;
@@ -317,7 +330,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)