From 86405dbb484947171da4b7c2c9444fe240847819 Mon Sep 17 00:00:00 2001 From: Duy-Nguyen Ta Date: Fri, 9 Sep 2016 07:10:04 -0400 Subject: [PATCH] pxd return value --- wrap/ReturnValue.cpp | 13 +++++++++++++ wrap/ReturnValue.h | 2 ++ 2 files changed, 15 insertions(+) diff --git a/wrap/ReturnValue.cpp b/wrap/ReturnValue.cpp index 1405e8e2b..d857f4a93 100644 --- a/wrap/ReturnValue.cpp +++ b/wrap/ReturnValue.cpp @@ -68,4 +68,17 @@ void ReturnValue::emit_matlab(FileWriter& proxyFile) const { } /* ************************************************************************* */ +void ReturnValue::emit_cython_pxd(FileWriter& file) const { + string output; + if (isPair) { + file.oss << "pair["; + type1.emit_cython_pxd(file); + file.oss << ","; + type1.emit_cython_pxd(file); + "] "; + } + else type1.emit_cython_pxd(file); +} + +/* ************************************************************************* */ diff --git a/wrap/ReturnValue.h b/wrap/ReturnValue.h index 629684a34..5a6fe24ec 100644 --- a/wrap/ReturnValue.h +++ b/wrap/ReturnValue.h @@ -67,6 +67,8 @@ struct ReturnValue { void emit_matlab(FileWriter& proxyFile) const; + void emit_cython_pxd(FileWriter& file) const; + friend std::ostream& operator<<(std::ostream& os, const ReturnValue& r) { if (!r.isPair && r.type1.category == ReturnType::VOID) os << "void";