summaryrefslogtreecommitdiff
path: root/cpp/src/Slice/CPlusPlusUtil.cpp
diff options
context:
space:
mode:
authorDwayne Boone <dwayne@zeroc.com>2006-03-20 14:02:01 +0000
committerDwayne Boone <dwayne@zeroc.com>2006-03-20 14:02:01 +0000
commit06ad21c2f678b3a34cc103b3083be9d96647e76d (patch)
tree46033285739df45469f86a0678e5081988dc0829 /cpp/src/Slice/CPlusPlusUtil.cpp
parentCatch exceptions from destroySession (diff)
downloadice-06ad21c2f678b3a34cc103b3083be9d96647e76d.tar.bz2
ice-06ad21c2f678b3a34cc103b3083be9d96647e76d.tar.xz
ice-06ad21c2f678b3a34cc103b3083be9d96647e76d.zip
Imrpoved support for using array mapping in async responses and Blobject.
Diffstat (limited to 'cpp/src/Slice/CPlusPlusUtil.cpp')
-rw-r--r--cpp/src/Slice/CPlusPlusUtil.cpp41
1 files changed, 28 insertions, 13 deletions
diff --git a/cpp/src/Slice/CPlusPlusUtil.cpp b/cpp/src/Slice/CPlusPlusUtil.cpp
index 66cead140c3..d3f368c6817 100644
--- a/cpp/src/Slice/CPlusPlusUtil.cpp
+++ b/cpp/src/Slice/CPlusPlusUtil.cpp
@@ -236,7 +236,7 @@ Slice::returnTypeToString(const TypePtr& type, const StringList& metaData)
}
string
-Slice::inputTypeToString(const TypePtr& type, const StringList& metaData)
+Slice::inputTypeToString(const TypePtr& type, const StringList& metaData, bool allowArray)
{
static const char* inputBuiltinTable[] =
{
@@ -283,28 +283,43 @@ Slice::inputTypeToString(const TypePtr& type, const StringList& metaData)
string seqType = findMetaData(metaData, true);
if(!seqType.empty())
{
+
if(seqType == "array" || seqType == "range:array")
{
- TypePtr elemType = seq->type();
- string s = typeToString(elemType);
- return "const ::std::pair<const " + s + "*, const " + s + "*>&";
+ if(allowArray)
+ {
+ TypePtr elemType = seq->type();
+ string s = typeToString(elemType);
+ return "const ::std::pair<const " + s + "*, const " + s + "*>&";
+ }
+ else
+ {
+ return "const " + fixKwd(seq->scoped()) + "&";
+ }
}
else if(seqType.find("range") == 0)
{
- string s;
- if(seqType.find("range:") == 0)
+ if(allowArray)
{
- s = seqType.substr(strlen("range:"));
+ string s;
+ if(seqType.find("range:") == 0)
+ {
+ s = seqType.substr(strlen("range:"));
+ }
+ else
+ {
+ s = fixKwd(seq->scoped());
+ }
+ if(s[0] == ':')
+ {
+ s = " " + s;
+ }
+ return "const ::std::pair<" + s + "::const_iterator, " + s + "::const_iterator>&";
}
else
{
- s = fixKwd(seq->scoped());
- }
- if(s[0] == ':')
- {
- s = " " + s;
+ return "const " + fixKwd(seq->scoped()) + "&";
}
- return "const ::std::pair<" + s + "::const_iterator, " + s + "::const_iterator>&";
}
else
{