diff options
author | Mark Spruiell <mes@zeroc.com> | 2018-02-07 08:56:00 -0800 |
---|---|---|
committer | Mark Spruiell <mes@zeroc.com> | 2018-02-07 08:56:00 -0800 |
commit | 63a054734193e482230ab22b840e5eadc696c9bb (patch) | |
tree | d8b29581670423708bf63a623078b962b3cf9a60 /matlab/src/Util.cpp | |
parent | Fixed Glacier2 potential NullHandleException (ICE-8575) (diff) | |
download | ice-63a054734193e482230ab22b840e5eadc696c9bb.tar.bz2 ice-63a054734193e482230ab22b840e5eadc696c9bb.tar.xz ice-63a054734193e482230ab22b840e5eadc696c9bb.zip |
ICE-7996 & ICE-7976 - Proxy updates for MATLAB
Diffstat (limited to 'matlab/src/Util.cpp')
-rw-r--r-- | matlab/src/Util.cpp | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/matlab/src/Util.cpp b/matlab/src/Util.cpp index 2ddc7e6dc1d..3e1e92998ac 100644 --- a/matlab/src/Util.cpp +++ b/matlab/src/Util.cpp @@ -535,6 +535,21 @@ IceMatlab::createResultException(mxArray* ex) return r; } +static const char* optionalFields[] = {"hasValue", "value"}; + +mxArray* +IceMatlab::createOptionalValue(bool hasValue, mxArray* value) +{ + mwSize dims[2] = {1, 1}; + auto r = mxCreateStructArray(2, dims, 2, optionalFields); + mxSetFieldByNumber(r, 0, 0, createBool(hasValue)); + if(hasValue) + { + mxSetFieldByNumber(r, 0, 1, value); + } + return r; +} + mxArray* IceMatlab::createStringList(const vector<string>& v) { |