summaryrefslogtreecommitdiff
path: root/cpp/src/slice2php/Main.cpp
diff options
context:
space:
mode:
authorMark Spruiell <mes@zeroc.com>2012-05-23 15:02:14 -0700
committerMark Spruiell <mes@zeroc.com>2012-05-23 15:02:14 -0700
commit0ce3ea49125e83ba758c66ab6c88142315d047d3 (patch)
tree1d8c549acf22d5abeaa30fae67a292970f294a34 /cpp/src/slice2php/Main.cpp
parentAdded implementation of optional data members encoding (not tested yet) (diff)
downloadice-0ce3ea49125e83ba758c66ab6c88142315d047d3.tar.bz2
ice-0ce3ea49125e83ba758c66ab6c88142315d047d3.tar.xz
ice-0ce3ea49125e83ba758c66ab6c88142315d047d3.zip
PHP port; misc. fixes
Diffstat (limited to 'cpp/src/slice2php/Main.cpp')
-rw-r--r--cpp/src/slice2php/Main.cpp11
1 files changed, 7 insertions, 4 deletions
diff --git a/cpp/src/slice2php/Main.cpp b/cpp/src/slice2php/Main.cpp
index 7a3209ad287..a30a16eca2d 100644
--- a/cpp/src/slice2php/Main.cpp
+++ b/cpp/src/slice2php/Main.cpp
@@ -388,8 +388,9 @@ CodeVisitor::visitClassDefStart(const ClassDefPtr& p)
//
// Emit the type information.
//
+ const bool preserved = p->hasMetaData("preserve-slice") || p->inheritsMetaData("preserve-slice");
_out << sp << nl << type << " = IcePHP_defineClass('" << scoped << "', '" << escapeName(abs) << "', "
- << (isAbstract ? "true" : "false") << ", ";
+ << (isAbstract ? "true" : "false") << ", " << (preserved ? "true" : "false") << ", ";
if(!base)
{
_out << "$Ice__t_Object";
@@ -459,7 +460,7 @@ CodeVisitor::visitClassDefStart(const ClassDefPtr& p)
//
// Define each operation. The arguments to IcePHP_defineOperation are:
//
- // $ClassType, 'opName', Mode, SendMode, (InParams), (OutParams), ReturnType, (Exceptions)
+ // $ClassType, 'opName', Mode, SendMode, FormatType, (InParams), (OutParams), ReturnType, (Exceptions)
//
// where InParams and OutParams are arrays of type descriptions, and Exceptions
// is an array of exception type ids.
@@ -475,7 +476,7 @@ CodeVisitor::visitClassDefStart(const ClassDefPtr& p)
_out << nl << "IcePHP_defineOperation(" << type << ", '" << (*oli)->name() << "', "
<< getOperationMode((*oli)->mode(), _ns) << ", " << getOperationMode((*oli)->sendMode(), _ns)
- << ", ";
+ << ", " << static_cast<int>((*oli)->format()) << ", ";
for(t = params.begin(), count = 0; t != params.end(); ++t)
{
if(!(*t)->isOutParam())
@@ -671,7 +672,9 @@ CodeVisitor::visitExceptionStart(const ExceptionPtr& p)
//
// Emit the type information.
//
- _out << sp << nl << type << " = IcePHP_defineException('" << scoped << "', '" << escapeName(abs) << "', ";
+ const bool preserved = p->hasMetaData("preserve-slice") || p->inheritsMetaData("preserve-slice");
+ _out << sp << nl << type << " = IcePHP_defineException('" << scoped << "', '" << escapeName(abs) << "', "
+ << (preserved ? "true" : "false") << ", ";
if(!base)
{
_out << "null";