summaryrefslogtreecommitdiff
path: root/cpp/src
diff options
context:
space:
mode:
Diffstat (limited to 'cpp/src')
-rw-r--r--cpp/src/slice2cpp/Gen.cpp12
-rw-r--r--cpp/src/slice2cppe/Gen.cpp12
-rwxr-xr-xcpp/src/slice2cs/Gen.cpp17
-rw-r--r--cpp/src/slice2java/Gen.cpp16
-rw-r--r--cpp/src/slice2javae/Gen.cpp16
5 files changed, 70 insertions, 3 deletions
diff --git a/cpp/src/slice2cpp/Gen.cpp b/cpp/src/slice2cpp/Gen.cpp
index 50d999bab66..ad5ececb464 100644
--- a/cpp/src/slice2cpp/Gen.cpp
+++ b/cpp/src/slice2cpp/Gen.cpp
@@ -1758,7 +1758,17 @@ Slice::Gen::ProxyVisitor::visitOperation(const OperationPtr& p)
string thisPointer = fixKwd(scope.substr(0, scope.size() - 2)) + "*";
H << sp;
- H << nl << retS << ' ' << fixKwd(name) << spar << paramsDecl << epar;
+ H << nl;
+ StringList metaData = p->getMetaData();
+ for(StringList::const_iterator q = metaData.begin(); q != metaData.end(); ++q)
+ {
+ if(q->find("deprecate") == 0)
+ {
+ H << "ICE_DEPRECATED_API ";
+ break;
+ }
+ }
+ H << retS << ' ' << fixKwd(name) << spar << paramsDecl << epar;
H << sb;
H << nl;
if(ret)
diff --git a/cpp/src/slice2cppe/Gen.cpp b/cpp/src/slice2cppe/Gen.cpp
index d094ef01509..db11e6b61d6 100644
--- a/cpp/src/slice2cppe/Gen.cpp
+++ b/cpp/src/slice2cppe/Gen.cpp
@@ -1425,7 +1425,17 @@ Slice::Gen::ProxyVisitor::visitOperation(const OperationPtr& p)
string thisPointer = fixKwd(scope.substr(0, scope.size() - 2)) + "*";
H << sp;
- H << nl << retS << ' ' << fixKwd(name) << spar << paramsDecl << epar;
+ H << nl;
+ StringList metaData = p->getMetaData();
+ for(StringList::const_iterator q = metaData.begin(); q != metaData.end(); ++q)
+ {
+ if(q->find("deprecate") == 0)
+ {
+ H << "ICE_DEPRECATED_API ";
+ break;
+ }
+ }
+ H << retS << ' ' << fixKwd(name) << spar << paramsDecl << epar;
H << sb;
H << nl;
if(ret)
diff --git a/cpp/src/slice2cs/Gen.cpp b/cpp/src/slice2cs/Gen.cpp
index 47a87d9ac85..4984b96d1ae 100755
--- a/cpp/src/slice2cs/Gen.cpp
+++ b/cpp/src/slice2cs/Gen.cpp
@@ -3117,7 +3117,22 @@ Slice::Gen::ProxyVisitor::visitOperation(const OperationPtr& p)
string name = fixId(p->name(), DotNet::ICloneable, true);
vector<string> params = getParams(p);
- _out << sp << nl << typeToString(p->returnType()) << " " << name << spar << params << epar << ';';
+ _out << sp;
+ StringList metaData = p->getMetaData();
+ for(StringList::const_iterator q = metaData.begin(); q != metaData.end(); ++q)
+ {
+ if(q->find("deprecate") == 0)
+ {
+ string reason = "This method has been deprecated.";
+ if(q->find("deprecate:") == 0)
+ {
+ reason = q->substr(10);
+ }
+ _out << nl << "[System.Obsolete(\"" << reason << "\")]";
+ break;
+ }
+ }
+ _out << nl << typeToString(p->returnType()) << " " << name << spar << params << epar << ';';
_out << nl << typeToString(p->returnType()) << " " << name
<< spar << params << "Ice.Context context__" << epar << ';';
diff --git a/cpp/src/slice2java/Gen.cpp b/cpp/src/slice2java/Gen.cpp
index 5d60f13c254..f362cd6647c 100644
--- a/cpp/src/slice2java/Gen.cpp
+++ b/cpp/src/slice2java/Gen.cpp
@@ -3632,6 +3632,22 @@ Slice::Gen::ProxyVisitor::visitOperation(const OperationPtr& p)
// context parameter.
//
out << sp;
+ StringList metaData = p->getMetaData();
+ for(StringList::const_iterator q = metaData.begin(); q != metaData.end(); ++q)
+ {
+ if(q->find("deprecate") == 0)
+ {
+ string reason = "This method has been deprecated.";
+ if(q->find("deprecate:") == 0)
+ {
+ reason = q->substr(10);
+ }
+ out << nl << "/**";
+ out << nl << " * @deprecated " << reason;
+ out << nl << " **/";
+ break;
+ }
+ }
out << nl << "public " << retS << ' ' << name << spar << params << epar;
writeThrowsClause(package, throws);
out << ';';
diff --git a/cpp/src/slice2javae/Gen.cpp b/cpp/src/slice2javae/Gen.cpp
index 2b0b0105fbd..91eab073cab 100644
--- a/cpp/src/slice2javae/Gen.cpp
+++ b/cpp/src/slice2javae/Gen.cpp
@@ -2790,6 +2790,22 @@ Slice::Gen::ProxyVisitor::visitOperation(const OperationPtr& p)
// context parameter.
//
out << sp;
+ StringList metaData = p->getMetaData();
+ for(StringList::const_iterator q = metaData.begin(); q != metaData.end(); ++q)
+ {
+ if(q->find("deprecate") == 0)
+ {
+ string reason = "This method has been deprecated.";
+ if(q->find("deprecate:") == 0)
+ {
+ reason = q->substr(10);
+ }
+ out << nl << "/**";
+ out << nl << " * @deprecated " << reason;
+ out << nl << " **/";
+ break;
+ }
+ }
out << nl << "public " << retS << ' ' << name << spar << params << epar;
writeThrowsClause(package, throws);
out << ';';