diff options
author | Jose <jose@zeroc.com> | 2017-03-20 11:11:16 +0100 |
---|---|---|
committer | Jose <jose@zeroc.com> | 2017-03-20 11:11:16 +0100 |
commit | 11c1140a8041b3dcdd79b9244422e56ebe8da10c (patch) | |
tree | 04cba9afe9ec7fb3e723ca45cb76afcfb5cc4885 /cpp/src/slice2cs | |
parent | Fixed (ICE-7678) - Python build failure with VS 2015 (diff) | |
download | ice-11c1140a8041b3dcdd79b9244422e56ebe8da10c.tar.bz2 ice-11c1140a8041b3dcdd79b9244422e56ebe8da10c.tar.xz ice-11c1140a8041b3dcdd79b9244422e56ebe8da10c.zip |
Update IceSSL::ConnectionInfo to use native certs and remove NativeConnectionInfo
Diffstat (limited to 'cpp/src/slice2cs')
-rw-r--r-- | cpp/src/slice2cs/CsUtil.cpp | 29 | ||||
-rw-r--r-- | cpp/src/slice2cs/CsUtil.h | 2 | ||||
-rw-r--r-- | cpp/src/slice2cs/Gen.cpp | 4 |
3 files changed, 31 insertions, 4 deletions
diff --git a/cpp/src/slice2cs/CsUtil.cpp b/cpp/src/slice2cs/CsUtil.cpp index 9f442018932..b2cd8c4efe8 100644 --- a/cpp/src/slice2cs/CsUtil.cpp +++ b/cpp/src/slice2cs/CsUtil.cpp @@ -261,7 +261,7 @@ Slice::CsGenerator::getStaticId(const TypePtr& type) } string -Slice::CsGenerator::typeToString(const TypePtr& type, bool optional, bool local) +Slice::CsGenerator::typeToString(const TypePtr& type, bool optional, bool local, const StringList& metaData) { if(!type) { @@ -305,6 +305,19 @@ Slice::CsGenerator::typeToString(const TypePtr& type, bool optional, bool local) "Ice.Value" }; + if(local) + { + for(StringList::const_iterator i = metaData.begin(); i != metaData.end(); ++i) + { + const string clrType = "cs:type:"; + const string meta = *i; + if(meta.find(clrType) == 0) + { + return meta.substr(clrType.size()); + } + } + } + BuiltinPtr builtin = BuiltinPtr::dynamicCast(type); if(builtin) { @@ -2539,6 +2552,20 @@ Slice::CsGenerator::MetaDataVisitor::validate(const ContainedPtr& cont) } } } + else if(DataMemberPtr::dynamicCast(cont)) + { + DataMemberPtr dataMember = DataMemberPtr::dynamicCast(cont); + StructPtr st = StructPtr::dynamicCast(dataMember->container()); + ExceptionPtr ex = ExceptionPtr::dynamicCast(dataMember->container()); + ClassDefPtr cl = ClassDefPtr::dynamicCast(dataMember->container()); + bool isLocal = (st && st->isLocal()) || (ex && ex->isLocal()) || (cl && cl->isLocal()); + static const string csTypePrefix = csPrefix + "type:"; + if(isLocal && s.find(csTypePrefix) == 0) + { + newLocalMetaData.push_back(s); + continue; + } + } static const string csAttributePrefix = csPrefix + "attribute:"; static const string csTie = csPrefix + "tie"; diff --git a/cpp/src/slice2cs/CsUtil.h b/cpp/src/slice2cs/CsUtil.h index 93d09a979f2..d5ad2bea645 100644 --- a/cpp/src/slice2cs/CsUtil.h +++ b/cpp/src/slice2cs/CsUtil.h @@ -41,7 +41,7 @@ protected: static std::string fixId(const ContainedPtr&, int = 0, bool = false); static std::string getOptionalFormat(const TypePtr&); static std::string getStaticId(const TypePtr&); - static std::string typeToString(const TypePtr&, bool = false, bool = false); + static std::string typeToString(const TypePtr&, bool = false, bool = false, const StringList& = StringList()); static bool isClassType(const TypePtr&); static bool isValueType(const TypePtr&); diff --git a/cpp/src/slice2cs/Gen.cpp b/cpp/src/slice2cs/Gen.cpp index c76e5385c86..a7b5016be1b 100644 --- a/cpp/src/slice2cs/Gen.cpp +++ b/cpp/src/slice2cs/Gen.cpp @@ -2296,7 +2296,7 @@ Slice::Gen::TypesVisitor::visitClassDefEnd(const ClassDefPtr& p) for(DataMemberList::const_iterator d = allDataMembers.begin(); d != allDataMembers.end(); ++d) { string memberName = fixId((*d)->name(), DotNet::ICloneable); - string memberType = typeToString((*d)->type(), (*d)->optional()); + string memberType = typeToString((*d)->type(), (*d)->optional(), p->isLocal(), (*d)->getMetaData()); paramDecl.push_back(memberType + " " + memberName); } _out << paramDecl << epar; @@ -3199,7 +3199,7 @@ Slice::Gen::TypesVisitor::visitDataMember(const DataMemberPtr& p) emitDeprecate(p, cont, _out, "member"); - string type = typeToString(p->type(), isOptional, isLocal); + string type = typeToString(p->type(), isOptional, isLocal, p->getMetaData()); string propertyName = fixId(p->name(), baseTypes, isClass); string dataMemberName; if(isProperty) |