From 9a002b337cbe9778988ab3e9b0888b97880f9c52 Mon Sep 17 00:00:00 2001 From: Anais AUBERT Date: Thu, 7 May 2015 11:34:50 +0200 Subject: [PATCH] fileinfo transposes intput matrix if it's not a column vector cd(TMPDIR); name = 'gw_example1'; table = ['sci_func1', 'func1']; WITHOUT_AUTO_PUTLHSVAR = %t; n1 = ilib_gen_gateway(name,table); r1 = fileinfo(n1) Change-Id: I8a03a4584f12fa9be3253cfcbc346956e2668fd0 --- .../fileio/sci_gateway/cpp/sci_fileinfo.cpp | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/scilab/modules/fileio/sci_gateway/cpp/sci_fileinfo.cpp b/scilab/modules/fileio/sci_gateway/cpp/sci_fileinfo.cpp index c474cc7..fc6f831 100644 --- a/scilab/modules/fileio/sci_gateway/cpp/sci_fileinfo.cpp +++ b/scilab/modules/fileio/sci_gateway/cpp/sci_fileinfo.cpp @@ -38,9 +38,9 @@ Function::ReturnValue sci_fileinfo(typed_list &in, int _iRetCount, typed_list &o return Function::Error; } - if (in[0]->isString() == false || in[0]->getAs()->getCols() != 1) + if (in[0]->isString() == false ) { - Scierror(999, _("%s: Wrong type for input argument: Column vector expected.\n"), "fileinfo"); + Scierror(999, _("%s: Wrong type for input argument #%d: A string expected.\n"), "fileinfo", 1); return Function::Error; } @@ -51,7 +51,14 @@ Function::ReturnValue sci_fileinfo(typed_list &in, int _iRetCount, typed_list &o } String* pS = in[0]->getAs(); + InternalType* iT = NULL; + String* pS1 = NULL; + if (pS->getCols() != 1) + { + pS->transpose(iT); + pS = iT->getAs(); + } int *piErr = new int[pS->getRows()]; double* pData = filesinfoW(pS->get(), pS->getRows(), piErr); -- 1.7.9.5