diff options
author | Michi Henning <michi@zeroc.com> | 2007-08-21 10:44:48 +1000 |
---|---|---|
committer | Michi Henning <michi@zeroc.com> | 2007-08-21 10:44:48 +1000 |
commit | b5229d0da48f3632a1b25580c448bb73bd7d987a (patch) | |
tree | 8b17ebbed93236b035fbf3e8e15db512ffb03dfd /cpp/src/Slice/CsUtil.cpp | |
parent | Added .gitignore (diff) | |
download | ice-b5229d0da48f3632a1b25580c448bb73bd7d987a.tar.bz2 ice-b5229d0da48f3632a1b25580c448bb73bd7d987a.tar.xz ice-b5229d0da48f3632a1b25580c448bb73bd7d987a.zip |
New dictionary mapping.
Diffstat (limited to 'cpp/src/Slice/CsUtil.cpp')
-rwxr-xr-x | cpp/src/Slice/CsUtil.cpp | 35 |
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); |