summaryrefslogtreecommitdiff
path: root/cpp/src
diff options
context:
space:
mode:
authorMatthew Newhook <matthew@zeroc.com>2002-03-25 17:06:25 +0000
committerMatthew Newhook <matthew@zeroc.com>2002-03-25 17:06:25 +0000
commite464333e9bd85025f8c025c7958233ffbb16d2a5 (patch)
treeff59c411f6a8f09567774a29414262419f52e47f /cpp/src
parentAdded to support Linux compilation. (diff)
downloadice-e464333e9bd85025f8c025c7958233ffbb16d2a5.tar.bz2
ice-e464333e9bd85025f8c025c7958233ffbb16d2a5.tar.xz
ice-e464333e9bd85025f8c025c7958233ffbb16d2a5.zip
Add annotation to return proxy types.
Diffstat (limited to 'cpp/src')
-rw-r--r--cpp/src/slice2xsd/Gen.cpp33
-rw-r--r--cpp/src/slice2xsd/Gen.h3
2 files changed, 11 insertions, 25 deletions
diff --git a/cpp/src/slice2xsd/Gen.cpp b/cpp/src/slice2xsd/Gen.cpp
index 3bebe758c5a..aac7dbc5117 100644
--- a/cpp/src/slice2xsd/Gen.cpp
+++ b/cpp/src/slice2xsd/Gen.cpp
@@ -138,7 +138,7 @@ Slice::Gen::visitClassDefStart(const ClassDefPtr& p)
O << se("xs:sequence");
for (DataMemberList::const_iterator q = dataMembers.begin(); q != dataMembers.end(); ++q)
{
- emitElement(*q);
+ emitElement((*q)->name(), (*q)->type());
}
O << ee; // xs:sequence
@@ -191,7 +191,7 @@ Slice::Gen::visitExceptionStart(const ExceptionPtr& p)
for (DataMemberList::const_iterator q = dataMembers.begin(); q != dataMembers.end(); ++q)
{
- emitElement(*q);
+ emitElement((*q)->name(), (*q)->type());
}
O << ee; // xs:sequence
@@ -228,7 +228,7 @@ Slice::Gen::visitStructStart(const StructPtr& p)
for (DataMemberList::const_iterator q = dataMembers.begin(); q != dataMembers.end(); ++q)
{
- emitElement(*q);
+ emitElement((*q)->name(), (*q)->type());
}
O << ee; // xs:sequence
@@ -262,7 +262,7 @@ Slice::Gen::visitOperation(const OperationPtr& p)
TypeStringList::const_iterator q;
for (q = in.begin(); q != in.end(); ++q)
{
- emitElement(*q);
+ emitElement(q->second, q->first);
}
O << ee; // xs:sequence
@@ -282,11 +282,12 @@ Slice::Gen::visitOperation(const OperationPtr& p)
O << se("xs:sequence");
if (ret)
{
- O << nl << "<xs:element name=\"__return\" type=\"" << toString(ret) << "\"/>";
+ emitElement("__return", ret);
+ //O << nl << "<xs:element name=\"__return\" type=\"" << toString(ret) << "\"/>";
}
for (q = out.begin(); q != out.end(); ++q)
{
- emitElement(*q);
+ emitElement(q->second, q->first);
}
O << ee; // xs:sequence
@@ -443,26 +444,12 @@ Slice::Gen::annotate(const ::std::string& type)
}
void
-Slice::Gen::emitElement(const DataMemberPtr& q)
+Slice::Gen::emitElement(const string& name, const TypePtr& type)
{
ostringstream os;
- os << "xs:element name=\"" << q->name() << "\" type=\"" << toString(q->type()) << '"';
+ os << "xs:element name=\"" << name << "\" type=\"" << toString(type) << '"';
O << se(os.str());
- ProxyPtr proxy = ProxyPtr::dynamicCast(q->type());
- if (proxy)
- {
- annotate(proxy->_class()->scoped());
- }
- O << ee; // xs:element
-}
-
-void
-Slice::Gen::emitElement(const TypeString& q)
-{
- ostringstream os;
- os << "xs:element name=\"" << q.second << "\" type=\"" << toString(q.first) << '"';
- O << se(os.str());
- ProxyPtr proxy = ProxyPtr::dynamicCast(q.first);
+ ProxyPtr proxy = ProxyPtr::dynamicCast(type);
if (proxy)
{
annotate(proxy->_class()->scoped());
diff --git a/cpp/src/slice2xsd/Gen.h b/cpp/src/slice2xsd/Gen.h
index 6acbd3d6d10..aedc4c3af95 100644
--- a/cpp/src/slice2xsd/Gen.h
+++ b/cpp/src/slice2xsd/Gen.h
@@ -45,8 +45,7 @@ private:
void printHeader();
void annotate(const ::std::string&);
- void emitElement(const DataMemberPtr&);
- void emitElement(const TypeString&);
+ void emitElement(const ::std::string&, const TypePtr&);
std::string containedToId(const ContainedPtr&);
std::string toString(const SyntaxTreeBasePtr&);