summaryrefslogtreecommitdiff
path: root/cpp/src/Slice/CsUtil.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'cpp/src/Slice/CsUtil.cpp')
-rwxr-xr-xcpp/src/Slice/CsUtil.cpp35
1 files changed, 34 insertions, 1 deletions
diff --git a/cpp/src/Slice/CsUtil.cpp b/cpp/src/Slice/CsUtil.cpp
index ad546d3b0b6..ca8b7bef66c 100755
--- a/cpp/src/Slice/CsUtil.cpp
+++ b/cpp/src/Slice/CsUtil.cpp
@@ -170,6 +170,16 @@ Slice::CsGenerator::typeToString(const TypePtr& type)
return typeToString(seq->type()) + "[]";
}
+ DictionaryPtr d = DictionaryPtr::dynamicCast(type);
+ if(d)
+ {
+ if(!d->hasMetaData("clr:DictionaryBase"))
+ {
+ return "_System.Collections.Generic.Dictionary<"
+ + typeToString(d->keyType()) + ", " + typeToString(d->valueType()) + ">";
+ }
+ }
+
ContainedPtr contained = ContainedPtr::dynamicCast(type);
if(contained)
{
@@ -529,7 +539,23 @@ Slice::CsGenerator::writeMarshalUnmarshalCode(Output &out,
}
assert(ConstructedPtr::dynamicCast(type));
- string typeS = typeToString(type);
+ string typeS;
+ DictionaryPtr d = DictionaryPtr::dynamicCast(type);
+ if(d)
+ {
+ if(!d->hasMetaData("clr:DictionaryBase"))
+ {
+ typeS = fixId(d->scoped());
+ }
+ else
+ {
+ typeS = typeToString(type);
+ }
+ }
+ else
+ {
+ typeS = typeToString(type);
+ }
if(marshal)
{
out << nl << typeS << "Helper.write(" << stream << ", " << param << ");";
@@ -1222,6 +1248,13 @@ Slice::CsGenerator::MetaDataVisitor::validate(const ContainedPtr& cont)
continue;
}
}
+ if(DictionaryPtr::dynamicCast(cont))
+ {
+ if(s.substr(prefix.size()) == "DictionaryBase")
+ {
+ continue;
+ }
+ }
cout << file << ":" << cont->line() << ": warning: ignoring invalid metadata `" << s << "'" << endl;
}
_history.insert(s);