summaryrefslogtreecommitdiff
path: root/cpp/src/slice2cppe/Gen.cpp
diff options
context:
space:
mode:
authorMark Spruiell <mes@zeroc.com>2006-04-06 12:47:53 +0000
committerMark Spruiell <mes@zeroc.com>2006-04-06 12:47:53 +0000
commit06f64b80862f8d972713a39951716b491c4bb4bb (patch)
tree21a6214e708db9e751bd65ddf861041d9d196cd5 /cpp/src/slice2cppe/Gen.cpp
parentdisable warnaserror for deprecated operation (diff)
downloadice-06f64b80862f8d972713a39951716b491c4bb4bb.tar.bz2
ice-06f64b80862f8d972713a39951716b491c4bb4bb.tar.xz
ice-06f64b80862f8d972713a39951716b491c4bb4bb.zip
adding more support for deprecate metadata
Diffstat (limited to 'cpp/src/slice2cppe/Gen.cpp')
-rw-r--r--cpp/src/slice2cppe/Gen.cpp29
1 files changed, 16 insertions, 13 deletions
diff --git a/cpp/src/slice2cppe/Gen.cpp b/cpp/src/slice2cppe/Gen.cpp
index db11e6b61d6..c8ea930d722 100644
--- a/cpp/src/slice2cppe/Gen.cpp
+++ b/cpp/src/slice2cppe/Gen.cpp
@@ -1424,18 +1424,14 @@ Slice::Gen::ProxyVisitor::visitOperation(const OperationPtr& p)
string thisPointer = fixKwd(scope.substr(0, scope.size() - 2)) + "*";
- H << sp;
- H << nl;
- StringList metaData = p->getMetaData();
- for(StringList::const_iterator q = metaData.begin(); q != metaData.end(); ++q)
+ ContainerPtr container = p->container();
+ ClassDefPtr cl = ClassDefPtr::dynamicCast(container);
+ string deprecateMetadata, deprecateSymbol;
+ if(p->findMetaData("deprecate", deprecateMetadata) || cl->findMetaData("deprecate", deprecateMetadata))
{
- if(q->find("deprecate") == 0)
- {
- H << "ICE_DEPRECATED_API ";
- break;
- }
+ deprecateSymbol = "ICE_DEPRECATED_API ";
}
- H << retS << ' ' << fixKwd(name) << spar << paramsDecl << epar;
+ H << sp << nl << deprecateSymbol << retS << ' ' << fixKwd(name) << spar << paramsDecl << epar;
H << sb;
H << nl;
if(ret)
@@ -1444,7 +1440,8 @@ Slice::Gen::ProxyVisitor::visitOperation(const OperationPtr& p)
}
H << fixKwd(name) << spar << args << "__defaultContext()" << epar << ';';
H << eb;
- H << nl << retS << ' ' << fixKwd(name) << spar << params << "const ::Ice::Context&" << epar << ';';
+ H << nl << deprecateSymbol << retS << ' ' << fixKwd(name) << spar << params << "const ::Ice::Context&" << epar
+ << ';';
C << sp << nl << retS << nl << "IceProxy" << scoped << spar << paramsDecl << "const ::Ice::Context& __ctx" << epar;
C << sb;
@@ -2123,7 +2120,6 @@ Slice::Gen::ObjectVisitor::visitOperation(const OperationPtr& p)
ContainerPtr container = p->container();
ClassDefPtr cl = ClassDefPtr::dynamicCast(container);
-
ParamDeclList inParams;
ParamDeclList outParams;
ParamDeclList paramList = p->parameters();
@@ -2182,8 +2178,15 @@ Slice::Gen::ObjectVisitor::visitOperation(const OperationPtr& p)
bool nonmutating = p->mode() == Operation::Nonmutating;
+ string deprecateMetadata, deprecateSymbol;
+ if(p->findMetaData("deprecate", deprecateMetadata) || cl->findMetaData("deprecate", deprecateMetadata))
+ {
+ deprecateSymbol = "ICE_DEPRECATED_API ";
+ }
+
H << sp;
- H << nl << "virtual " << retS << ' ' << fixKwd(name) << params << (nonmutating ? " const" : "") << " = 0;";
+ H << nl << deprecateSymbol << "virtual " << retS << ' ' << fixKwd(name) << params << (nonmutating ? " const" : "")
+ << " = 0;";
if(!cl->isLocal())
{