summaryrefslogtreecommitdiff
path: root/cpp/src/slice2cpp/GenUtil.cpp
diff options
context:
space:
mode:
authorMarc Laukien <marc@zeroc.com>2001-07-16 03:16:50 +0000
committerMarc Laukien <marc@zeroc.com>2001-07-16 03:16:50 +0000
commit3c17ec5fa963060b99d8d0043a69091975840c24 (patch)
treec980e4f9a214bfa0d6c00f2c82a337b8be5367b0 /cpp/src/slice2cpp/GenUtil.cpp
parentmore exception tests/changes (diff)
downloadice-3c17ec5fa963060b99d8d0043a69091975840c24.tar.bz2
ice-3c17ec5fa963060b99d8d0043a69091975840c24.tar.xz
ice-3c17ec5fa963060b99d8d0043a69091975840c24.zip
more exception stuff
Diffstat (limited to 'cpp/src/slice2cpp/GenUtil.cpp')
-rw-r--r--cpp/src/slice2cpp/GenUtil.cpp46
1 files changed, 46 insertions, 0 deletions
diff --git a/cpp/src/slice2cpp/GenUtil.cpp b/cpp/src/slice2cpp/GenUtil.cpp
index d6a48b60bfe..42da4f6bbc8 100644
--- a/cpp/src/slice2cpp/GenUtil.cpp
+++ b/cpp/src/slice2cpp/GenUtil.cpp
@@ -148,6 +148,52 @@ Slice::outputTypeToString(const Type_ptr& type)
return "???";
}
+string
+Slice::exceptionTypeToString(const Type_ptr& type)
+{
+ static const char* inputBuiltinTable[] =
+ {
+ "::Ice::Byte",
+ "bool",
+ "::Ice::Short",
+ "::Ice::Int",
+ "::Ice::Long",
+ "::Ice::Float",
+ "::Ice::Double",
+ "const ::std::string&",
+ "const ::std::wstring&",
+ "const ::Ice::Object_ptrE&",
+ "const ::Ice::Object_prx&",
+ "const ::Ice::LocalObject_ptrE&"
+ };
+
+ Builtin_ptr builtin = Builtin_ptr::dynamicCast(type);
+ if(builtin)
+ return inputBuiltinTable[builtin -> kind()];
+
+ ClassDecl_ptr cl = ClassDecl_ptr::dynamicCast(type);
+ if(cl)
+ return "const " + cl -> scoped() + "_ptrE&";
+
+ Proxy_ptr proxy = Proxy_ptr::dynamicCast(type);
+ if(proxy)
+ return "const " + proxy -> _class() -> scoped() + "_prx&";
+
+ Enum_ptr en = Enum_ptr::dynamicCast(type);
+ if(en)
+ return en -> scoped();
+
+ Native_ptr native = Native_ptr::dynamicCast(type);
+ if(native)
+ return native -> scoped();
+
+ Contained_ptr contained = Contained_ptr::dynamicCast(type);
+ if(contained)
+ return "const " + contained -> scoped() + "&";
+
+ return "???";
+}
+
void
Slice::writeMarshalUnmarshalCode(Output& out, const Type_ptr& type,
const string& param, bool marshal)