new types toString function to take care "lines" values (double, int, bool, string) 03/7003/3
Antoine ELIAS [Tue, 17 Apr 2012 15:08:26 +0000 (17:08 +0200)]
Change-Id: If7fa624d983578f5c77b409471e1a54a36014040

95 files changed:
scilab/modules/ast/Makefile.am
scilab/modules/ast/Makefile.in
scilab/modules/ast/ast.vcxproj
scilab/modules/ast/includes/runvisitor.hxx
scilab/modules/boolean/Makefile.am
scilab/modules/boolean/Makefile.in
scilab/modules/boolean/src/cpp/boolean_gw.vcxproj
scilab/modules/core/src/cpp/core_gw.vcxproj
scilab/modules/differential_equations/Makefile.am
scilab/modules/differential_equations/Makefile.in
scilab/modules/differential_equations/sci_gateway/differential_equations_gw.vcxproj
scilab/modules/differential_equations/src/c/differential_equations.vcxproj
scilab/modules/elementary_functions/Makefile.am
scilab/modules/elementary_functions/Makefile.in
scilab/modules/elementary_functions/sci_gateway/cpp/elem_func_gw/elem_func_gw.vcxproj
scilab/modules/functions/sci_gateway/cpp/sci_exec.cpp
scilab/modules/functions/sci_gateway/cpp/sci_execstr.cpp
scilab/modules/functions_manager/functions_manager.vcxproj
scilab/modules/linear_algebra/Makefile.am
scilab/modules/linear_algebra/Makefile.in
scilab/modules/linear_algebra/sci_gateway/cpp/linear_algebra_gw.vcxproj
scilab/modules/mexlib/Makefile.am
scilab/modules/mexlib/Makefile.in
scilab/modules/mexlib/src/cpp/mexlib.cpp
scilab/modules/mexlib/src/libmat/libmat.vcxproj
scilab/modules/mexlib/src/libmex/libmex.vcxproj
scilab/modules/mexlib/src/libmx/libmx.vcxproj
scilab/modules/output_stream/sci_gateway/cpp/output_stream_gw/output_stream_gw.vcxproj
scilab/modules/output_stream/sci_gateway/cpp/sci_disp.cpp
scilab/modules/string/sci_gateway/cpp/sci_string.cpp
scilab/modules/system_env/src/cpp/configvariable.cpp
scilab/modules/types/includes/arrayof.hxx
scilab/modules/types/includes/bool.hxx
scilab/modules/types/includes/cell.hxx
scilab/modules/types/includes/double.hxx
scilab/modules/types/includes/float.hxx
scilab/modules/types/includes/function.hxx
scilab/modules/types/includes/graphichandle.hxx
scilab/modules/types/includes/implicitlist.hxx
scilab/modules/types/includes/int16.hxx
scilab/modules/types/includes/int32.hxx
scilab/modules/types/includes/int64.hxx
scilab/modules/types/includes/int8.hxx
scilab/modules/types/includes/internal.hxx
scilab/modules/types/includes/list.hxx
scilab/modules/types/includes/listdelete.hxx
scilab/modules/types/includes/listinsert.hxx
scilab/modules/types/includes/listoperation.hxx
scilab/modules/types/includes/listundefined.hxx
scilab/modules/types/includes/macro.hxx
scilab/modules/types/includes/macrofile.hxx
scilab/modules/types/includes/polynom.hxx
scilab/modules/types/includes/singlepoly.hxx
scilab/modules/types/includes/singlestruct.hxx
scilab/modules/types/includes/sparse.hxx
scilab/modules/types/includes/string.hxx
scilab/modules/types/includes/struct.hxx
scilab/modules/types/includes/threadId.hxx
scilab/modules/types/includes/tostring_common.hxx
scilab/modules/types/includes/uint16.hxx
scilab/modules/types/includes/uint32.hxx
scilab/modules/types/includes/uint64.hxx
scilab/modules/types/includes/uint8.hxx
scilab/modules/types/includes/user.hxx
scilab/modules/types/sci_gateway/cpp/sci_usertype.cpp
scilab/modules/types/src/cpp/bool.cpp
scilab/modules/types/src/cpp/cell.cpp
scilab/modules/types/src/cpp/double.cpp
scilab/modules/types/src/cpp/float.cpp
scilab/modules/types/src/cpp/function.cpp
scilab/modules/types/src/cpp/graphichandle.cpp
scilab/modules/types/src/cpp/implicitlist.cpp
scilab/modules/types/src/cpp/int16.cpp
scilab/modules/types/src/cpp/int32.cpp
scilab/modules/types/src/cpp/int64.cpp
scilab/modules/types/src/cpp/int8.cpp
scilab/modules/types/src/cpp/list.cpp
scilab/modules/types/src/cpp/listdelete.cpp
scilab/modules/types/src/cpp/listinsert.cpp
scilab/modules/types/src/cpp/listoperation.cpp
scilab/modules/types/src/cpp/listundefined.cpp
scilab/modules/types/src/cpp/macro.cpp
scilab/modules/types/src/cpp/macrofile.cpp
scilab/modules/types/src/cpp/polynom.cpp
scilab/modules/types/src/cpp/singlepoly.cpp
scilab/modules/types/src/cpp/singlestruct.cpp
scilab/modules/types/src/cpp/sparse.cpp
scilab/modules/types/src/cpp/string.cpp
scilab/modules/types/src/cpp/struct.cpp
scilab/modules/types/src/cpp/threadId.cpp
scilab/modules/types/src/cpp/uint16.cpp
scilab/modules/types/src/cpp/uint32.cpp
scilab/modules/types/src/cpp/uint64.cpp
scilab/modules/types/src/cpp/uint8.cpp
scilab/modules/types/system_env_Import.def

index 40292d3..c272886 100644 (file)
@@ -30,6 +30,7 @@ libsciast_la_CPPFLAGS = \
     -I$(top_srcdir)/modules/symbol/includes \
        -I$(top_srcdir)/modules/types/includes \
        -I$(top_srcdir)/modules/functions_manager/includes \
+       -I$(top_srcdir)/modules/console/includes \
        -I$(top_srcdir)/modules/elementary_functions/includes \
        -I$(top_srcdir)/modules/operations/includes \
        -I$(top_srcdir)/modules/output_stream/includes \
index c3bee8e..b222671 100644 (file)
@@ -439,6 +439,7 @@ libsciast_la_CPPFLAGS = \
     -I$(top_srcdir)/modules/symbol/includes \
        -I$(top_srcdir)/modules/types/includes \
        -I$(top_srcdir)/modules/functions_manager/includes \
+       -I$(top_srcdir)/modules/console/includes \
        -I$(top_srcdir)/modules/elementary_functions/includes \
        -I$(top_srcdir)/modules/operations/includes \
        -I$(top_srcdir)/modules/output_stream/includes \
index d908069..d73369a 100644 (file)
@@ -76,7 +76,7 @@
   <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
     <ClCompile>
       <Optimization>Disabled</Optimization>
-      <AdditionalIncludeDirectories>includes;..\symbol\includes;..\types\includes;..\functions_manager\includes;../core/includes;..\elementary_functions\includes;../operations/includes;../localization/includes;../../libs/intl;../output_stream/includes;../system_env/includes;../string/includes;../api_scilab/includes;../threads/includes;../../libs/dynamiclibrary/includes;../../libs/Eigen/includes;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+      <AdditionalIncludeDirectories>includes;..\symbol\includes;..\types\includes;..\functions_manager\includes;../core/includes;..\elementary_functions\includes;../operations/includes;../localization/includes;../../libs/intl;../output_stream/includes;../system_env/includes;../string/includes;../api_scilab/includes;../threads/includes;../../libs/dynamiclibrary/includes;../../libs/Eigen/includes;../console/includes;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
       <PreprocessorDefinitions>WIN32;_DEBUG;_WINDOWS;_USRDLL;AST_EXPORTS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
       <MinimalRebuild>true</MinimalRebuild>
       <BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks>
     </Midl>
     <ClCompile>
       <Optimization>Disabled</Optimization>
-      <AdditionalIncludeDirectories>includes;..\symbol\includes;..\types\includes;..\functions_manager\includes;../core/includes;..\elementary_functions\includes;../operations/includes;../localization/includes;../../libs/intl;../output_stream/includes;../system_env/includes;../string/includes;../api_scilab/includes;../threads/includes;../../libs/dynamiclibrary/includes;../../libs/Eigen/includes;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+      <AdditionalIncludeDirectories>includes;..\symbol\includes;..\types\includes;..\functions_manager\includes;../core/includes;..\elementary_functions\includes;../operations/includes;../localization/includes;../../libs/intl;../output_stream/includes;../system_env/includes;../string/includes;../api_scilab/includes;../threads/includes;../../libs/dynamiclibrary/includes;../../libs/Eigen/includes;../console/includes;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
       <PreprocessorDefinitions>WIN32;_DEBUG;_WINDOWS;_USRDLL;AST_EXPORTS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
       <MinimalRebuild>true</MinimalRebuild>
       <BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks>
     <ClCompile>
       <Optimization>MaxSpeed</Optimization>
       <IntrinsicFunctions>true</IntrinsicFunctions>
-      <AdditionalIncludeDirectories>includes;..\symbol\includes;..\types\includes;..\functions_manager\includes;../core/includes;..\elementary_functions\includes;../operations/includes;../localization/includes;../../libs/intl;../output_stream/includes;../system_env/includes;../string/includes;../api_scilab/includes;../threads/includes;../../libs/dynamiclibrary/includes;../../libs/Eigen/includes;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+      <AdditionalIncludeDirectories>includes;..\symbol\includes;..\types\includes;..\functions_manager\includes;../core/includes;..\elementary_functions\includes;../operations/includes;../localization/includes;../../libs/intl;../output_stream/includes;../system_env/includes;../string/includes;../api_scilab/includes;../threads/includes;../../libs/dynamiclibrary/includes;../../libs/Eigen/includes;../console/includes;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
       <PreprocessorDefinitions>WIN32;NDEBUG;_WINDOWS;_USRDLL;AST_EXPORTS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
       <RuntimeLibrary>MultiThreadedDLL</RuntimeLibrary>
       <FunctionLevelLinking>true</FunctionLevelLinking>
     <ClCompile>
       <Optimization>MaxSpeed</Optimization>
       <IntrinsicFunctions>true</IntrinsicFunctions>
-      <AdditionalIncludeDirectories>includes;..\symbol\includes;..\types\includes;..\functions_manager\includes;../core/includes;..\elementary_functions\includes;../operations/includes;../localization/includes;../../libs/intl;../output_stream/includes;../system_env/includes;../string/includes;../api_scilab/includes;../threads/includes;../../libs/dynamiclibrary/includes;../../libs/Eigen/includes;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+      <AdditionalIncludeDirectories>includes;..\symbol\includes;..\types\includes;..\functions_manager\includes;../core/includes;..\elementary_functions\includes;../operations/includes;../localization/includes;../../libs/intl;../output_stream/includes;../system_env/includes;../string/includes;../api_scilab/includes;../threads/includes;../../libs/dynamiclibrary/includes;../../libs/Eigen/includes;../console/includes;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
       <PreprocessorDefinitions>WIN32;NDEBUG;_WINDOWS;_USRDLL;AST_EXPORTS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
       <RuntimeLibrary>MultiThreadedDLL</RuntimeLibrary>
       <FunctionLevelLinking>true</FunctionLevelLinking>
       <Project>{43c5bab1-1dca-4743-a183-77e0d42fe7d0}</Project>
       <ReferenceOutputAssembly>false</ReferenceOutputAssembly>
     </ProjectReference>
+    <ProjectReference Include="..\console\src\c\console.vcxproj">
+      <Project>{445d3b85-c9b1-498b-9c88-0a3c2390b1cc}</Project>
+    </ProjectReference>
     <ProjectReference Include="..\localization\src\localization.vcxproj">
       <Project>{ecffeb0c-1eda-45ee-9a10-b18143852e17}</Project>
       <ReferenceOutputAssembly>false</ReferenceOutputAssembly>
index 229fe90..1a5b7a9 100644 (file)
@@ -39,6 +39,7 @@ extern "C" {
 #include "doublecomplex.h"
 #include "matrix_transpose.h"
 #include "os_swprintf.h"
+#include "more.h"
 }
 
 #include "timer.hxx"
@@ -1588,9 +1589,9 @@ namespace ast
 
         void VariableToString(types::InternalType* pIT)
         {
-            std::wostringstream ostr;
             if(pIT->isMList() || pIT->isTList())
             {//call overload %type_p
+                std::wostringstream ostr;
                 types::typed_list in;
                 types::typed_list out;
 
@@ -1603,17 +1604,33 @@ namespace ast
                 }
                 catch(ScilabError /*&e*/)
                 {
-                    ostr << pIT->toString();
+                    pIT->toString(ostr);
+                    scilabWriteW(ostr.str().c_str());
                 }
                 
                 pIT->DecreaseRef();
             }
             else
             {
-                ostr << pIT->toString();
-            }
+                std::wostringstream ostr;
 
-            scilabWriteW(ostr.str().c_str());
+                //to manage lines information
+                int iLines = ConfigVariable::getConsoleLines();
+
+                bool bFinish = false;
+                do
+                {//block by block
+                    bFinish = pIT->toString(ostr);
+                    scilabWriteW(ostr.str().c_str());
+                    if(bFinish == false && iLines != 0)
+                    {//show message on prompt
+                        bFinish = linesmore() == 1;
+                    }
+                    ostr.str(L"");
+                }while(bFinish == false);
+
+                pIT->clearPrintState();
+            }
         }
 
         /** \} */
index 45e1616..f32d4fc 100644 (file)
@@ -33,6 +33,7 @@ libsciboolean_la_CPPFLAGS = \
     -I$(top_srcdir)/modules/symbol/includes \
     -I$(top_srcdir)/modules/ast/includes \
     -I$(top_srcdir)/modules/elementary_functions/includes \
+    -I$(top_srcdir)/modules/console/includes \
     -I$(top_srcdir)/modules/core/includes \
     -I$(top_srcdir)/modules/operations/includes \
     -I$(top_srcdir)/modules/output_stream/includes \
index c1084f4..0fe5286 100644 (file)
@@ -458,6 +458,7 @@ libsciboolean_la_CPPFLAGS = \
     -I$(top_srcdir)/modules/symbol/includes \
     -I$(top_srcdir)/modules/ast/includes \
     -I$(top_srcdir)/modules/elementary_functions/includes \
+    -I$(top_srcdir)/modules/console/includes \
     -I$(top_srcdir)/modules/core/includes \
     -I$(top_srcdir)/modules/operations/includes \
     -I$(top_srcdir)/modules/output_stream/includes \
index 681f09a..083e8e5 100644 (file)
@@ -76,7 +76,7 @@
   <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
     <ClCompile>
       <Optimization>Disabled</Optimization>
-      <AdditionalIncludeDirectories>../../includes;../../../functions_manager/includes;../../../types/includes;../../../symbol/includes;../../../ast/includes;../../../elementary_functions/includes;../../../core/includes;../../../operations/includes;../../../api_scilab/includes;../../../localization/includes;../../../../libs/intl;../../../output_stream/includes;../../../../libs/dynamiclibrary/includes;../../../../libs/MALLOC/includes;../../../../libs/Eigen/includes;../../../system_env/includes;../../../threads/includes;../../../string/includes;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+      <AdditionalIncludeDirectories>../../includes;../../../functions_manager/includes;../../../types/includes;../../../symbol/includes;../../../ast/includes;../../../elementary_functions/includes;../../../core/includes;../../../operations/includes;../../../api_scilab/includes;../../../localization/includes;../../../../libs/intl;../../../output_stream/includes;../../../../libs/dynamiclibrary/includes;../../../../libs/MALLOC/includes;../../../../libs/Eigen/includes;../../../system_env/includes;../../../threads/includes;../../../string/includes;../../../console/includes;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
       <PreprocessorDefinitions>WIN32;_DEBUG;_WINDOWS;_USRDLL;BOOLEAN_GW_EXPORTS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
       <MinimalRebuild>true</MinimalRebuild>
       <BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks>
     </Midl>
     <ClCompile>
       <Optimization>Disabled</Optimization>
-      <AdditionalIncludeDirectories>../../includes;../../../functions_manager/includes;../../../types/includes;../../../symbol/includes;../../../ast/includes;../../../elementary_functions/includes;../../../core/includes;../../../operations/includes;../../../api_scilab/includes;../../../localization/includes;../../../../libs/intl;../../../output_stream/includes;../../../../libs/dynamiclibrary/includes;../../../../libs/MALLOC/includes;../../../../libs/Eigen/includes;../../../system_env/includes;../../../threads/includes;../../../string/includes;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+      <AdditionalIncludeDirectories>../../includes;../../../functions_manager/includes;../../../types/includes;../../../symbol/includes;../../../ast/includes;../../../elementary_functions/includes;../../../core/includes;../../../operations/includes;../../../api_scilab/includes;../../../localization/includes;../../../../libs/intl;../../../output_stream/includes;../../../../libs/dynamiclibrary/includes;../../../../libs/MALLOC/includes;../../../../libs/Eigen/includes;../../../system_env/includes;../../../threads/includes;../../../string/includes;../../../console/includes;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
       <PreprocessorDefinitions>WIN32;_DEBUG;_WINDOWS;_USRDLL;BOOLEAN_GW_EXPORTS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
       <MinimalRebuild>true</MinimalRebuild>
       <BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks>
     <ClCompile>
       <Optimization>MaxSpeed</Optimization>
       <IntrinsicFunctions>true</IntrinsicFunctions>
-      <AdditionalIncludeDirectories>../../includes;../../../functions_manager/includes;../../../types/includes;../../../symbol/includes;../../../ast/includes;../../../elementary_functions/includes;../../../core/includes;../../../operations/includes;../../../api_scilab/includes;../../../localization/includes;../../../../libs/intl;../../../output_stream/includes;../../../../libs/dynamiclibrary/includes;../../../../libs/MALLOC/includes;../../../../libs/Eigen/includes;../../../system_env/includes;../../../threads/includes;../../../string/includes;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+      <AdditionalIncludeDirectories>../../includes;../../../functions_manager/includes;../../../types/includes;../../../symbol/includes;../../../ast/includes;../../../elementary_functions/includes;../../../core/includes;../../../operations/includes;../../../api_scilab/includes;../../../localization/includes;../../../../libs/intl;../../../output_stream/includes;../../../../libs/dynamiclibrary/includes;../../../../libs/MALLOC/includes;../../../../libs/Eigen/includes;../../../system_env/includes;../../../threads/includes;../../../string/includes;../../../console/includes;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
       <PreprocessorDefinitions>WIN32;NDEBUG;_WINDOWS;_USRDLL;BOOLEAN_GW_EXPORTS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
       <RuntimeLibrary>MultiThreadedDLL</RuntimeLibrary>
       <FunctionLevelLinking>true</FunctionLevelLinking>
     <ClCompile>
       <Optimization>MaxSpeed</Optimization>
       <IntrinsicFunctions>true</IntrinsicFunctions>
-      <AdditionalIncludeDirectories>../../includes;../../../functions_manager/includes;../../../types/includes;../../../symbol/includes;../../../ast/includes;../../../elementary_functions/includes;../../../core/includes;../../../operations/includes;../../../api_scilab/includes;../../../localization/includes;../../../../libs/intl;../../../output_stream/includes;../../../../libs/dynamiclibrary/includes;../../../../libs/MALLOC/includes;../../../../libs/Eigen/includes;../../../system_env/includes;../../../threads/includes;../../../string/includes;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+      <AdditionalIncludeDirectories>../../includes;../../../functions_manager/includes;../../../types/includes;../../../symbol/includes;../../../ast/includes;../../../elementary_functions/includes;../../../core/includes;../../../operations/includes;../../../api_scilab/includes;../../../localization/includes;../../../../libs/intl;../../../output_stream/includes;../../../../libs/dynamiclibrary/includes;../../../../libs/MALLOC/includes;../../../../libs/Eigen/includes;../../../system_env/includes;../../../threads/includes;../../../string/includes;../../../console/includes;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
       <PreprocessorDefinitions>WIN32;NDEBUG;_WINDOWS;_USRDLL;BOOLEAN_GW_EXPORTS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
       <RuntimeLibrary>MultiThreadedDLL</RuntimeLibrary>
       <FunctionLevelLinking>true</FunctionLevelLinking>
     <ProjectReference Include="..\..\..\ast\ast.vcxproj">
       <Project>{0d3fa25b-8116-44ec-a45e-260789daa3d9}</Project>
     </ProjectReference>
+    <ProjectReference Include="..\..\..\console\src\c\console.vcxproj">
+      <Project>{445d3b85-c9b1-498b-9c88-0a3c2390b1cc}</Project>
+    </ProjectReference>
     <ProjectReference Include="..\..\..\localization\src\localization.vcxproj">
       <Project>{ecffeb0c-1eda-45ee-9a10-b18143852e17}</Project>
       <ReferenceOutputAssembly>false</ReferenceOutputAssembly>
index 7049a25..bf878bb 100644 (file)
@@ -76,7 +76,7 @@
   <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
     <ClCompile>
       <Optimization>Disabled</Optimization>
-      <AdditionalIncludeDirectories>../../includes;../../src/c;../../../functions_manager/includes;../../../types/includes;../../../symbol/includes;../../../ast/includes;../../../elementary_functions/includes;../../../operations/includes;../../../api_scilab/includes;../../../output_stream/includes;../../../localization/includes;../../../../libs/intl;../../../system_env/includes;../../../../libs/MALLOC/includes;../../../string/includes;../../../fileio/includes;../../../threads/includes;../../../../libs/dynamiclibrary/includes;../../../../libs/Eigen/includes;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+      <AdditionalIncludeDirectories>../../includes;../../src/c;../../../functions_manager/includes;../../../types/includes;../../../symbol/includes;../../../ast/includes;../../../elementary_functions/includes;../../../operations/includes;../../../api_scilab/includes;../../../output_stream/includes;../../../localization/includes;../../../../libs/intl;../../../system_env/includes;../../../../libs/MALLOC/includes;../../../string/includes;../../../fileio/includes;../../../threads/includes;../../../../libs/dynamiclibrary/includes;../../../../libs/Eigen/includes;../../../console/includes;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
       <PreprocessorDefinitions>WIN32;_DEBUG;_WINDOWS;_USRDLL;CORE_GW_EXPORTS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
       <MinimalRebuild>true</MinimalRebuild>
       <BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks>
     </Midl>
     <ClCompile>
       <Optimization>Disabled</Optimization>
-      <AdditionalIncludeDirectories>../../includes;../../src/c;../../../functions_manager/includes;../../../types/includes;../../../symbol/includes;../../../ast/includes;../../../elementary_functions/includes;../../../operations/includes;../../../api_scilab/includes;../../../output_stream/includes;../../../localization/includes;../../../../libs/intl;../../../system_env/includes;../../../../libs/MALLOC/includes;../../../string/includes;../../../fileio/includes;../../../threads/includes;../../../../libs/dynamiclibrary/includes;../../../../libs/Eigen/includes;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+      <AdditionalIncludeDirectories>../../includes;../../src/c;../../../functions_manager/includes;../../../types/includes;../../../symbol/includes;../../../ast/includes;../../../elementary_functions/includes;../../../operations/includes;../../../api_scilab/includes;../../../output_stream/includes;../../../localization/includes;../../../../libs/intl;../../../system_env/includes;../../../../libs/MALLOC/includes;../../../string/includes;../../../fileio/includes;../../../threads/includes;../../../../libs/dynamiclibrary/includes;../../../../libs/Eigen/includes;../../../console/includes;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
       <PreprocessorDefinitions>WIN32;_DEBUG;_WINDOWS;_USRDLL;CORE_GW_EXPORTS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
       <MinimalRebuild>true</MinimalRebuild>
       <BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks>
     <ClCompile>
       <Optimization>MaxSpeed</Optimization>
       <IntrinsicFunctions>true</IntrinsicFunctions>
-      <AdditionalIncludeDirectories>../../includes;../../src/c;../../../functions_manager/includes;../../../types/includes;../../../symbol/includes;../../../ast/includes;../../../elementary_functions/includes;../../../operations/includes;../../../api_scilab/includes;../../../output_stream/includes;../../../localization/includes;../../../../libs/intl;../../../system_env/includes;../../../../libs/MALLOC/includes;../../../string/includes;../../../fileio/includes;../../../threads/includes;../../../../libs/dynamiclibrary/includes;../../../../libs/Eigen/includes;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+      <AdditionalIncludeDirectories>../../includes;../../src/c;../../../functions_manager/includes;../../../types/includes;../../../symbol/includes;../../../ast/includes;../../../elementary_functions/includes;../../../operations/includes;../../../api_scilab/includes;../../../output_stream/includes;../../../localization/includes;../../../../libs/intl;../../../system_env/includes;../../../../libs/MALLOC/includes;../../../string/includes;../../../fileio/includes;../../../threads/includes;../../../../libs/dynamiclibrary/includes;../../../../libs/Eigen/includes;../../../console/includes;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
       <PreprocessorDefinitions>WIN32;NDEBUG;_WINDOWS;_USRDLL;CORE_GW_EXPORTS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
       <RuntimeLibrary>MultiThreadedDLL</RuntimeLibrary>
       <FunctionLevelLinking>true</FunctionLevelLinking>
     <ClCompile>
       <Optimization>MaxSpeed</Optimization>
       <IntrinsicFunctions>true</IntrinsicFunctions>
-      <AdditionalIncludeDirectories>../../includes;../../src/c;../../../functions_manager/includes;../../../types/includes;../../../symbol/includes;../../../ast/includes;../../../elementary_functions/includes;../../../operations/includes;../../../api_scilab/includes;../../../output_stream/includes;../../../localization/includes;../../../../libs/intl;../../../system_env/includes;../../../../libs/MALLOC/includes;../../../string/includes;../../../fileio/includes;../../../threads/includes;../../../../libs/dynamiclibrary/includes;../../../../libs/Eigen/includes;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+      <AdditionalIncludeDirectories>../../includes;../../src/c;../../../functions_manager/includes;../../../types/includes;../../../symbol/includes;../../../ast/includes;../../../elementary_functions/includes;../../../operations/includes;../../../api_scilab/includes;../../../output_stream/includes;../../../localization/includes;../../../../libs/intl;../../../system_env/includes;../../../../libs/MALLOC/includes;../../../string/includes;../../../fileio/includes;../../../threads/includes;../../../../libs/dynamiclibrary/includes;../../../../libs/Eigen/includes;../../../console/includes;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
       <PreprocessorDefinitions>WIN32;NDEBUG;_WINDOWS;_USRDLL;CORE_GW_EXPORTS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
       <RuntimeLibrary>MultiThreadedDLL</RuntimeLibrary>
       <FunctionLevelLinking>true</FunctionLevelLinking>
       <Project>{43c5bab1-1dca-4743-a183-77e0d42fe7d0}</Project>
       <ReferenceOutputAssembly>false</ReferenceOutputAssembly>
     </ProjectReference>
+    <ProjectReference Include="..\..\..\console\src\c\console.vcxproj">
+      <Project>{445d3b85-c9b1-498b-9c88-0a3c2390b1cc}</Project>
+    </ProjectReference>
     <ProjectReference Include="..\..\..\fileio\fileio.vcxproj">
       <Project>{4fc72d4a-80ee-4b1a-8724-0201c1a35621}</Project>
       <ReferenceOutputAssembly>false</ReferenceOutputAssembly>
index 47693d9..a9d5451 100644 (file)
@@ -102,6 +102,7 @@ libscidifferential_equations_la_CPPFLAGS= -I$(srcdir)/includes/ \
 -I$(top_srcdir)/modules/localization/includes/ \
 -I$(top_srcdir)/modules/output_stream/includes/ \
 -I$(top_srcdir)/modules/api_scilab/includes/ \
+-I$(top_srcdir)/modules/console/includes/ \
 -I$(top_srcdir)/modules/dynamic_link/includes/ \
 -I$(top_srcdir)/modules/symbol/includes/ \
 -I$(top_srcdir)/modules/ast/includes/ \
index 53115f6..85c5463 100644 (file)
@@ -557,6 +557,7 @@ libscidifferential_equations_la_CPPFLAGS = -I$(srcdir)/includes/ \
 -I$(top_srcdir)/modules/localization/includes/ \
 -I$(top_srcdir)/modules/output_stream/includes/ \
 -I$(top_srcdir)/modules/api_scilab/includes/ \
+-I$(top_srcdir)/modules/console/includes/ \
 -I$(top_srcdir)/modules/dynamic_link/includes/ \
 -I$(top_srcdir)/modules/symbol/includes/ \
 -I$(top_srcdir)/modules/ast/includes/ \
index 366aa0a..3bc4ef9 100644 (file)
@@ -77,7 +77,7 @@
     <ClCompile>
       <AdditionalOptions>%(AdditionalOptions)</AdditionalOptions>
       <Optimization>Disabled</Optimization>
-      <AdditionalIncludeDirectories>../includes;../src/c;../../types/includes;../../ast/includes;../../core/includes;../../../libs/dynamiclibrary/includes;../../../libs/intl;../../localization/includes;../../system_env/includes;../../api_scilab/includes;../../symbol/includes;../../operations/includes;../../threads/includes;../../output_stream/includes;../../elementary_functions/includes;../../string/includes;../../../libs/Eigen/includes;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+      <AdditionalIncludeDirectories>../includes;../src/c;../../types/includes;../../ast/includes;../../core/includes;../../../libs/dynamiclibrary/includes;../../../libs/intl;../../localization/includes;../../system_env/includes;../../api_scilab/includes;../../symbol/includes;../../operations/includes;../../threads/includes;../../output_stream/includes;../../elementary_functions/includes;../../string/includes;../../../libs/Eigen/includes;../../console/includes;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
       <PreprocessorDefinitions>_CRT_SECURE_NO_DEPRECATE;FORDLL;_DEBUG;_WINDOWS;_USRDLL;DIFFERENTIAL_EQUATIONS_GW_EXPORTS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
       <MinimalRebuild>true</MinimalRebuild>
       <BasicRuntimeChecks>Default</BasicRuntimeChecks>
     </Midl>
     <ClCompile>
       <Optimization>Disabled</Optimization>
-      <AdditionalIncludeDirectories>../includes;../src/c;../../types/includes;../../ast/includes;../../core/includes;../../../libs/dynamiclibrary/includes;../../../libs/intl;../../localization/includes;../../system_env/includes;../../api_scilab/includes;../../symbol/includes;../../operations/includes;../../threads/includes;../../output_stream/includes;../../elementary_functions/includes;../../string/includes;../../../libs/Eigen/includes;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+      <AdditionalIncludeDirectories>../includes;../src/c;../../types/includes;../../ast/includes;../../core/includes;../../../libs/dynamiclibrary/includes;../../../libs/intl;../../localization/includes;../../system_env/includes;../../api_scilab/includes;../../symbol/includes;../../operations/includes;../../threads/includes;../../output_stream/includes;../../elementary_functions/includes;../../string/includes;../../../libs/Eigen/includes;../../console/includes;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
       <PreprocessorDefinitions>_CRT_SECURE_NO_DEPRECATE;FORDLL;_DEBUG;_WINDOWS;_USRDLL;DIFFERENTIAL_EQUATIONS_GW_EXPORTS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
       <MinimalRebuild>true</MinimalRebuild>
       <BasicRuntimeChecks>Default</BasicRuntimeChecks>
       <InlineFunctionExpansion>OnlyExplicitInline</InlineFunctionExpansion>
       <FavorSizeOrSpeed>Speed</FavorSizeOrSpeed>
       <WholeProgramOptimization>false</WholeProgramOptimization>
-      <AdditionalIncludeDirectories>../includes;../src/c;../../types/includes;../../ast/includes;../../core/includes;../../../libs/dynamiclibrary/includes;../../../libs/intl;../../localization/includes;../../system_env/includes;../../api_scilab/includes;../../symbol/includes;../../operations/includes;../../threads/includes;../../output_stream/includes;../../elementary_functions/includes;../../string/includes;../../../libs/Eigen/includes;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+      <AdditionalIncludeDirectories>../includes;../src/c;../../types/includes;../../ast/includes;../../core/includes;../../../libs/dynamiclibrary/includes;../../../libs/intl;../../localization/includes;../../system_env/includes;../../api_scilab/includes;../../symbol/includes;../../operations/includes;../../threads/includes;../../output_stream/includes;../../elementary_functions/includes;../../string/includes;../../../libs/Eigen/includes;../../console/includes;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
       <PreprocessorDefinitions>_CRT_SECURE_NO_DEPRECATE;FORDLL;NDEBUG;_WINDOWS;_USRDLL;DIFFERENTIAL_EQUATIONS_GW_EXPORTS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
       <StringPooling>true</StringPooling>
       <RuntimeLibrary>MultiThreadedDLL</RuntimeLibrary>
       <InlineFunctionExpansion>OnlyExplicitInline</InlineFunctionExpansion>
       <FavorSizeOrSpeed>Speed</FavorSizeOrSpeed>
       <WholeProgramOptimization>false</WholeProgramOptimization>
-      <AdditionalIncludeDirectories>../includes;../src/c;../../types/includes;../../ast/includes;../../core/includes;../../../libs/dynamiclibrary/includes;../../../libs/intl;../../localization/includes;../../system_env/includes;../../api_scilab/includes;../../symbol/includes;../../operations/includes;../../threads/includes;../../output_stream/includes;../../elementary_functions/includes;../../string/includes;../../../libs/Eigen/includes;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+      <AdditionalIncludeDirectories>../includes;../src/c;../../types/includes;../../ast/includes;../../core/includes;../../../libs/dynamiclibrary/includes;../../../libs/intl;../../localization/includes;../../system_env/includes;../../api_scilab/includes;../../symbol/includes;../../operations/includes;../../threads/includes;../../output_stream/includes;../../elementary_functions/includes;../../string/includes;../../../libs/Eigen/includes;../../console/includes;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
       <PreprocessorDefinitions>_CRT_SECURE_NO_DEPRECATE;FORDLL;NDEBUG;_WINDOWS;_USRDLL;DIFFERENTIAL_EQUATIONS_GW_EXPORTS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
       <StringPooling>true</StringPooling>
       <RuntimeLibrary>MultiThreadedDLL</RuntimeLibrary>
     <ClCompile Include="cpp\sci_odedc.cpp" />
   </ItemGroup>
   <ItemGroup>
+    <ProjectReference Include="..\..\console\src\c\console.vcxproj">
+      <Project>{445d3b85-c9b1-498b-9c88-0a3c2390b1cc}</Project>
+    </ProjectReference>
     <ProjectReference Include="..\..\localization\src\localization.vcxproj">
       <Project>{ecffeb0c-1eda-45ee-9a10-b18143852e17}</Project>
     </ProjectReference>
index 3c8d3f6..24ba113 100644 (file)
@@ -76,7 +76,7 @@
   <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
     <ClCompile>
       <Optimization>Disabled</Optimization>
-      <AdditionalIncludeDirectories>.;../../includes;../../../../libs/MALLOC/includes;../../../core/includes;../../../output_stream/includes;../../../dynamic_link/includes;../../../dynamic_link/src/c;../../../localization/includes;../../../core/src/c;../../../../libs/intl;../../../differential_equations/includes;../../../api_scilab/includes;../../../elementary_functions/includes;../../../system_env/includes;../../../ast/includes;../../../types/includes;../../../symbol/includes;../../../threads/includes;../../../operations/includes;../../../../libs/dynamiclibrary/includes;../../../string/includes;../../../../libs/Eigen/includes;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+      <AdditionalIncludeDirectories>.;../../includes;../../../../libs/MALLOC/includes;../../../core/includes;../../../output_stream/includes;../../../dynamic_link/includes;../../../dynamic_link/src/c;../../../localization/includes;../../../core/src/c;../../../../libs/intl;../../../differential_equations/includes;../../../api_scilab/includes;../../../elementary_functions/includes;../../../system_env/includes;../../../ast/includes;../../../types/includes;../../../symbol/includes;../../../threads/includes;../../../operations/includes;../../../../libs/dynamiclibrary/includes;../../../string/includes;../../../../libs/Eigen/includes;../../../console/includes;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
       <PreprocessorDefinitions>_CRT_SECURE_NO_DEPRECATE;FORDLL;_DEBUG;_WINDOWS;_USRDLL;DIFFERENTIAL_EQUATIONS_EXPORTS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
       <RuntimeLibrary>MultiThreadedDebugDLL</RuntimeLibrary>
       <WarningLevel>Level3</WarningLevel>
@@ -104,7 +104,7 @@ lib /DEF:"$(ProjectDir)differential_equations_f_Import.def" /SUBSYSTEM:WINDOWS /
     </Midl>
     <ClCompile>
       <Optimization>Disabled</Optimization>
-      <AdditionalIncludeDirectories>.;../../includes;../../../../libs/MALLOC/includes;../../../core/includes;../../../output_stream/includes;../../../dynamic_link/includes;../../../dynamic_link/src/c;../../../localization/includes;../../../core/src/c;../../../../libs/intl;../../../differential_equations/includes;../../../api_scilab/includes;../../../elementary_functions/includes;../../../system_env/includes;../../../ast/includes;../../../types/includes;../../../symbol/includes;../../../threads/includes;../../../operations/includes;../../../../libs/dynamiclibrary/includes;../../../string/includes;../../../../libs/Eigen/includes;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+      <AdditionalIncludeDirectories>.;../../includes;../../../../libs/MALLOC/includes;../../../core/includes;../../../output_stream/includes;../../../dynamic_link/includes;../../../dynamic_link/src/c;../../../localization/includes;../../../core/src/c;../../../../libs/intl;../../../differential_equations/includes;../../../api_scilab/includes;../../../elementary_functions/includes;../../../system_env/includes;../../../ast/includes;../../../types/includes;../../../symbol/includes;../../../threads/includes;../../../operations/includes;../../../../libs/dynamiclibrary/includes;../../../string/includes;../../../../libs/Eigen/includes;../../../console/includes;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
       <PreprocessorDefinitions>_CRT_SECURE_NO_DEPRECATE;FORDLL;_DEBUG;_WINDOWS;_USRDLL;DIFFERENTIAL_EQUATIONS_EXPORTS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
       <RuntimeLibrary>MultiThreadedDebugDLL</RuntimeLibrary>
       <WarningLevel>Level3</WarningLevel>
@@ -130,7 +130,7 @@ lib /DEF:"$(ProjectDir)differential_equations_f_Import.def" /SUBSYSTEM:WINDOWS /
     <ClCompile>
       <FavorSizeOrSpeed>Speed</FavorSizeOrSpeed>
       <WholeProgramOptimization>false</WholeProgramOptimization>
-      <AdditionalIncludeDirectories>.;../../includes;../../../../libs/MALLOC/includes;../../../core/includes;../../../output_stream/includes;../../../dynamic_link/includes;../../../dynamic_link/src/c;../../../localization/includes;../../../core/src/c;../../../../libs/intl;../../../differential_equations/includes;../../../api_scilab/includes;../../../elementary_functions/includes;../../../system_env/includes;../../../ast/includes;../../../types/includes;../../../symbol/includes;../../../threads/includes;../../../operations/includes;../../../../libs/dynamiclibrary/includes;../../../string/includes;../../../../libs/Eigen/includes;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+      <AdditionalIncludeDirectories>.;../../includes;../../../../libs/MALLOC/includes;../../../core/includes;../../../output_stream/includes;../../../dynamic_link/includes;../../../dynamic_link/src/c;../../../localization/includes;../../../core/src/c;../../../../libs/intl;../../../differential_equations/includes;../../../api_scilab/includes;../../../elementary_functions/includes;../../../system_env/includes;../../../ast/includes;../../../types/includes;../../../symbol/includes;../../../threads/includes;../../../operations/includes;../../../../libs/dynamiclibrary/includes;../../../string/includes;../../../../libs/Eigen/includes;../../../console/includes;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
       <PreprocessorDefinitions>_CRT_SECURE_NO_DEPRECATE;FORDLL;NDEBUG;_WINDOWS;_USRDLL;DIFFERENTIAL_EQUATIONS_EXPORTS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
       <StringPooling>true</StringPooling>
       <RuntimeLibrary>MultiThreadedDLL</RuntimeLibrary>
@@ -163,7 +163,7 @@ lib /DEF:"$(ProjectDir)differential_equations_f_Import.def" /SUBSYSTEM:WINDOWS /
     <ClCompile>
       <FavorSizeOrSpeed>Speed</FavorSizeOrSpeed>
       <WholeProgramOptimization>false</WholeProgramOptimization>
-      <AdditionalIncludeDirectories>.;../../includes;../../../../libs/MALLOC/includes;../../../core/includes;../../../output_stream/includes;../../../dynamic_link/includes;../../../dynamic_link/src/c;../../../localization/includes;../../../core/src/c;../../../../libs/intl;../../../differential_equations/includes;../../../api_scilab/includes;../../../elementary_functions/includes;../../../system_env/includes;../../../ast/includes;../../../types/includes;../../../symbol/includes;../../../threads/includes;../../../operations/includes;../../../../libs/dynamiclibrary/includes;../../../string/includes;../../../../libs/Eigen/includes;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+      <AdditionalIncludeDirectories>.;../../includes;../../../../libs/MALLOC/includes;../../../core/includes;../../../output_stream/includes;../../../dynamic_link/includes;../../../dynamic_link/src/c;../../../localization/includes;../../../core/src/c;../../../../libs/intl;../../../differential_equations/includes;../../../api_scilab/includes;../../../elementary_functions/includes;../../../system_env/includes;../../../ast/includes;../../../types/includes;../../../symbol/includes;../../../threads/includes;../../../operations/includes;../../../../libs/dynamiclibrary/includes;../../../string/includes;../../../../libs/Eigen/includes;../../../console/includes;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
       <PreprocessorDefinitions>_CRT_SECURE_NO_DEPRECATE;FORDLL;NDEBUG;_WINDOWS;_USRDLL;DIFFERENTIAL_EQUATIONS_EXPORTS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
       <StringPooling>true</StringPooling>
       <RuntimeLibrary>MultiThreadedDLL</RuntimeLibrary>
@@ -238,6 +238,9 @@ lib /DEF:"$(ProjectDir)differential_equations_f_Import.def" /SUBSYSTEM:WINDOWS /
     <ProjectReference Include="..\..\..\ast\ast.vcxproj">
       <Project>{0d3fa25b-8116-44ec-a45e-260789daa3d9}</Project>
     </ProjectReference>
+    <ProjectReference Include="..\..\..\console\src\c\console.vcxproj">
+      <Project>{445d3b85-c9b1-498b-9c88-0a3c2390b1cc}</Project>
+    </ProjectReference>
     <ProjectReference Include="..\..\..\dynamic_link\src\c\dynamic_link.vcxproj">
       <Project>{eab6c580-22b3-4359-ba1d-dd7499a96163}</Project>
       <ReferenceOutputAssembly>false</ReferenceOutputAssembly>
index 1f8e28a..bd69656 100644 (file)
@@ -396,6 +396,7 @@ libscielementary_functions_la_CPPFLAGS = -I$(srcdir)/includes/ \
        -I$(top_srcdir)/libs/MALLOC/includes/ \
        -I$(top_srcdir)/libs/dynamiclibrary/includes/ \
        -I$(top_srcdir)/modules/api_scilab/includes/ \
+       -I$(top_srcdir)/modules/console/includes/ \
        -I$(top_srcdir)/modules/localization/includes/ \
        -I$(top_srcdir)/modules/output_stream/includes/ \
        -I$(top_srcdir)/modules/operations/includes/ \
index 5329989..8da5495 100644 (file)
@@ -980,6 +980,7 @@ libscielementary_functions_la_CPPFLAGS = -I$(srcdir)/includes/ \
        -I$(top_srcdir)/libs/MALLOC/includes/ \
        -I$(top_srcdir)/libs/dynamiclibrary/includes/ \
        -I$(top_srcdir)/modules/api_scilab/includes/ \
+       -I$(top_srcdir)/modules/console/includes/ \
        -I$(top_srcdir)/modules/localization/includes/ \
        -I$(top_srcdir)/modules/output_stream/includes/ \
        -I$(top_srcdir)/modules/operations/includes/ \
index 4e72115..b322211 100644 (file)
@@ -76,7 +76,7 @@
   <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
     <ClCompile>
       <Optimization>Disabled</Optimization>
-      <AdditionalIncludeDirectories>..\..\..\includes;..\..\..\..\functions_manager\includes;..\..\..\..\symbol\includes;..\..\..\..\types\includes;..\..\..\..\operations\includes;..\..\..\..\core\includes;../../../../ast/includes;../../../../api_scilab/includes;../../../../output_stream/includes;../../../../localization/includes;../../../../../libs/intl/;../../../../threads/includes;../../../../system_env/includes;../../../../string/includes;../../../../../libs/dynamiclibrary/includes;../../../../double/includes;..\..\..\src\c;../../../../../libs/MALLOC/includes;../../../../../libs/Eigen/includes;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+      <AdditionalIncludeDirectories>..\..\..\includes;..\..\..\..\functions_manager\includes;..\..\..\..\symbol\includes;..\..\..\..\types\includes;..\..\..\..\operations\includes;..\..\..\..\core\includes;../../../../ast/includes;../../../../api_scilab/includes;../../../../output_stream/includes;../../../../localization/includes;../../../../../libs/intl/;../../../../threads/includes;../../../../system_env/includes;../../../../string/includes;../../../../../libs/dynamiclibrary/includes;../../../../double/includes;..\..\..\src\c;../../../../../libs/MALLOC/includes;../../../../../libs/Eigen/includes;../../../../console/includes;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
       <PreprocessorDefinitions>WIN32;_DEBUG;_WINDOWS;_USRDLL;ELEM_FUNC_GW_EXPORTS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
       <MinimalRebuild>true</MinimalRebuild>
       <BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks>
@@ -110,7 +110,7 @@ lib /DEF:"$(ProjectDir)core_f_Import.def" /SUBSYSTEM:WINDOWS /MACHINE:$(Platform
     </Midl>
     <ClCompile>
       <Optimization>Disabled</Optimization>
-      <AdditionalIncludeDirectories>..\..\..\includes;..\..\..\..\functions_manager\includes;..\..\..\..\symbol\includes;..\..\..\..\types\includes;..\..\..\..\operations\includes;..\..\..\..\core\includes;../../../../ast/includes;../../../../api_scilab/includes;../../../../output_stream/includes;../../../../localization/includes;../../../../../libs/intl/;../../../../threads/includes;../../../../system_env/includes;../../../../string/includes;../../../../../libs/dynamiclibrary/includes;../../../../double/includes;..\..\..\src\c;../../../../../libs/MALLOC/includes;../../../../../libs/Eigen/includes;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+      <AdditionalIncludeDirectories>..\..\..\includes;..\..\..\..\functions_manager\includes;..\..\..\..\symbol\includes;..\..\..\..\types\includes;..\..\..\..\operations\includes;..\..\..\..\core\includes;../../../../ast/includes;../../../../api_scilab/includes;../../../../output_stream/includes;../../../../localization/includes;../../../../../libs/intl/;../../../../threads/includes;../../../../system_env/includes;../../../../string/includes;../../../../../libs/dynamiclibrary/includes;../../../../double/includes;..\..\..\src\c;../../../../../libs/MALLOC/includes;../../../../../libs/Eigen/includes;../../../../console/includes;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
       <PreprocessorDefinitions>WIN32;_DEBUG;_WINDOWS;_USRDLL;ELEM_FUNC_GW_EXPORTS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
       <MinimalRebuild>true</MinimalRebuild>
       <BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks>
@@ -142,7 +142,7 @@ lib /DEF:"$(ProjectDir)core_f_Import.def" /SUBSYSTEM:WINDOWS /MACHINE:$(Platform
     <ClCompile>
       <Optimization>MaxSpeed</Optimization>
       <IntrinsicFunctions>true</IntrinsicFunctions>
-      <AdditionalIncludeDirectories>..\..\..\includes;..\..\..\..\functions_manager\includes;..\..\..\..\symbol\includes;..\..\..\..\types\includes;..\..\..\..\operations\includes;..\..\..\..\core\includes;../../../../ast/includes;../../../../api_scilab/includes;../../../../output_stream/includes;../../../../localization/includes;../../../../../libs/intl/;../../../../threads/includes;../../../../system_env/includes;../../../../string/includes;../../../../../libs/dynamiclibrary/includes;../../../../double/includes;..\..\..\src\c;../../../../../libs/MALLOC/includes;../../../../../libs/Eigen/includes;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+      <AdditionalIncludeDirectories>..\..\..\includes;..\..\..\..\functions_manager\includes;..\..\..\..\symbol\includes;..\..\..\..\types\includes;..\..\..\..\operations\includes;..\..\..\..\core\includes;../../../../ast/includes;../../../../api_scilab/includes;../../../../output_stream/includes;../../../../localization/includes;../../../../../libs/intl/;../../../../threads/includes;../../../../system_env/includes;../../../../string/includes;../../../../../libs/dynamiclibrary/includes;../../../../double/includes;..\..\..\src\c;../../../../../libs/MALLOC/includes;../../../../../libs/Eigen/includes;../../../../console/includes;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
       <PreprocessorDefinitions>WIN32;NDEBUG;_WINDOWS;_USRDLL;ELEM_FUNC_GW_EXPORTS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
       <RuntimeLibrary>MultiThreadedDLL</RuntimeLibrary>
       <FunctionLevelLinking>true</FunctionLevelLinking>
@@ -179,7 +179,7 @@ lib /DEF:"$(ProjectDir)core_f_Import.def" /SUBSYSTEM:WINDOWS /MACHINE:$(Platform
     <ClCompile>
       <Optimization>MaxSpeed</Optimization>
       <IntrinsicFunctions>true</IntrinsicFunctions>
-      <AdditionalIncludeDirectories>..\..\..\includes;..\..\..\..\functions_manager\includes;..\..\..\..\symbol\includes;..\..\..\..\types\includes;..\..\..\..\operations\includes;..\..\..\..\core\includes;../../../../ast/includes;../../../../api_scilab/includes;../../../../output_stream/includes;../../../../localization/includes;../../../../../libs/intl/;../../../../threads/includes;../../../../system_env/includes;../../../../string/includes;../../../../../libs/dynamiclibrary/includes;../../../../double/includes;..\..\..\src\c;../../../../../libs/MALLOC/includes;../../../../../libs/Eigen/includes;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+      <AdditionalIncludeDirectories>..\..\..\includes;..\..\..\..\functions_manager\includes;..\..\..\..\symbol\includes;..\..\..\..\types\includes;..\..\..\..\operations\includes;..\..\..\..\core\includes;../../../../ast/includes;../../../../api_scilab/includes;../../../../output_stream/includes;../../../../localization/includes;../../../../../libs/intl/;../../../../threads/includes;../../../../system_env/includes;../../../../string/includes;../../../../../libs/dynamiclibrary/includes;../../../../double/includes;..\..\..\src\c;../../../../../libs/MALLOC/includes;../../../../../libs/Eigen/includes;../../../../console/includes;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
       <PreprocessorDefinitions>WIN32;NDEBUG;_WINDOWS;_USRDLL;ELEM_FUNC_GW_EXPORTS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
       <RuntimeLibrary>MultiThreadedDLL</RuntimeLibrary>
       <FunctionLevelLinking>true</FunctionLevelLinking>
@@ -303,6 +303,8 @@ lib /DEF:"$(ProjectDir)core_f_Import.def" /SUBSYSTEM:WINDOWS /MACHINE:$(Platform
     </ProjectReference>
     <ProjectReference Include="..\..\..\..\core\src\c\core.vcxproj">
       <Project>{c6e2bc17-34d8-46e4-85f3-6293cb21adcd}</Project>
+    <ProjectReference Include="..\..\..\..\console\src\c\console.vcxproj">
+      <Project>{445d3b85-c9b1-498b-9c88-0a3c2390b1cc}</Project>
     </ProjectReference>
     <ProjectReference Include="..\..\..\..\localization\src\localization.vcxproj">
       <Project>{ecffeb0c-1eda-45ee-9a10-b18143852e17}</Project>
index e7b9a5a..cc6e38e 100644 (file)
@@ -305,7 +305,8 @@ Function::ReturnValue sci_exec(types::typed_list &in, int _iRetCount, types::typ
                         std::wostringstream ostr;
                         ostr << L" ans  =" << std::endl;
                         ostr << std::endl;
-                        ostr << pITAns->toString() << std::endl;
+                        pITAns->toString(ostr);
+                        ostr << std::endl;
                         scilabWriteW(ostr.str().c_str());
                     }
                 }
index bcc2446..31df937 100644 (file)
@@ -252,7 +252,8 @@ Function::ReturnValue sci_execstr(types::typed_list &in, int _iRetCount, types::
                                        std::wostringstream ostr;
                                        ostr << L" ans  =" << std::endl;
                                        ostr << std::endl;
-                                       ostr << pITAns->toString() << std::endl;
+                    pITAns->toString(ostr);
+                                       ostr << std::endl;
                                        scilabWriteW(ostr.str().c_str());
                                }
                        }
index abda1c6..045ad3b 100644 (file)
@@ -72,7 +72,7 @@
   <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
     <ClCompile>
       <Optimization>Disabled</Optimization>
-      <AdditionalIncludeDirectories>includes;../../libs/MALLOC/includes;../types/includes;../core/includes;../system_env/includes;../../libs/libxml2;../symbol/includes;../operations/includes;../ast/includes;../fileio/includes;../parse/includes;../localization/includes;../../libs/intl;../output_stream/includes;../string/includes;../api_scilab/includes;../threads/includes;../jvm/includes;../../libs/dynamiclibrary/includes;../../libs/Eigen/includes;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+      <AdditionalIncludeDirectories>includes;../../libs/MALLOC/includes;../types/includes;../core/includes;../system_env/includes;../../libs/libxml2;../symbol/includes;../operations/includes;../ast/includes;../fileio/includes;../parse/includes;../localization/includes;../../libs/intl;../output_stream/includes;../string/includes;../api_scilab/includes;../threads/includes;../jvm/includes;../../libs/dynamiclibrary/includes;../../libs/Eigen/includes;../console/includes;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
       <PreprocessorDefinitions>WIN32;_DEBUG;_WINDOWS;_USRDLL;FUNC_MAN_EXPORTS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
       <MinimalRebuild>true</MinimalRebuild>
       <BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks>
@@ -95,7 +95,7 @@
     </Midl>
     <ClCompile>
       <Optimization>Disabled</Optimization>
-      <AdditionalIncludeDirectories>includes;../../libs/MALLOC/includes;../types/includes;../core/includes;../system_env/includes;../../libs/libxml2;../symbol/includes;../operations/includes;../ast/includes;../fileio/includes;../parse/includes;../localization/includes;../../libs/intl;../output_stream/includes;../string/includes;../api_scilab/includes;../threads/includes;../jvm/includes;../../libs/dynamiclibrary/includes;../../libs/Eigen/includes;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+      <AdditionalIncludeDirectories>includes;../../libs/MALLOC/includes;../types/includes;../core/includes;../system_env/includes;../../libs/libxml2;../symbol/includes;../operations/includes;../ast/includes;../fileio/includes;../parse/includes;../localization/includes;../../libs/intl;../output_stream/includes;../string/includes;../api_scilab/includes;../threads/includes;../jvm/includes;../../libs/dynamiclibrary/includes;../../libs/Eigen/includes;../console/includes;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
       <PreprocessorDefinitions>WIN32;_DEBUG;_WINDOWS;_USRDLL;FUNC_MAN_EXPORTS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
       <MinimalRebuild>true</MinimalRebuild>
       <BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks>
     <ClCompile>
       <Optimization>MaxSpeed</Optimization>
       <IntrinsicFunctions>true</IntrinsicFunctions>
-      <AdditionalIncludeDirectories>includes;../../libs/MALLOC/includes;../types/includes;../core/includes;../system_env/includes;../../libs/libxml2;../symbol/includes;../operations/includes;../ast/includes;../fileio/includes;../parse/includes;../localization/includes;../../libs/intl;../output_stream/includes;../string/includes;../api_scilab/includes;../threads/includes;../jvm/includes;../../libs/dynamiclibrary/includes;../../libs/Eigen/includes;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+      <AdditionalIncludeDirectories>includes;../../libs/MALLOC/includes;../types/includes;../core/includes;../system_env/includes;../../libs/libxml2;../symbol/includes;../operations/includes;../ast/includes;../fileio/includes;../parse/includes;../localization/includes;../../libs/intl;../output_stream/includes;../string/includes;../api_scilab/includes;../threads/includes;../jvm/includes;../../libs/dynamiclibrary/includes;../../libs/Eigen/includes;../console/includes;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
       <PreprocessorDefinitions>WIN32;NDEBUG;_WINDOWS;_USRDLL;FUNC_MAN_EXPORTS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
       <RuntimeLibrary>MultiThreadedDLL</RuntimeLibrary>
       <FunctionLevelLinking>true</FunctionLevelLinking>
     <ClCompile>
       <Optimization>MaxSpeed</Optimization>
       <IntrinsicFunctions>true</IntrinsicFunctions>
-      <AdditionalIncludeDirectories>includes;../../libs/MALLOC/includes;../types/includes;../core/includes;../system_env/includes;../../libs/libxml2;../symbol/includes;../operations/includes;../ast/includes;../fileio/includes;../parse/includes;../localization/includes;../../libs/intl;../output_stream/includes;../string/includes;../api_scilab/includes;../threads/includes;../jvm/includes;../../libs/dynamiclibrary/includes;../../libs/Eigen/includes;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+      <AdditionalIncludeDirectories>includes;../../libs/MALLOC/includes;../types/includes;../core/includes;../system_env/includes;../../libs/libxml2;../symbol/includes;../operations/includes;../ast/includes;../fileio/includes;../parse/includes;../localization/includes;../../libs/intl;../output_stream/includes;../string/includes;../api_scilab/includes;../threads/includes;../jvm/includes;../../libs/dynamiclibrary/includes;../../libs/Eigen/includes;../console/includes;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
       <PreprocessorDefinitions>WIN32;NDEBUG;_WINDOWS;_USRDLL;FUNC_MAN_EXPORTS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
       <RuntimeLibrary>MultiThreadedDLL</RuntimeLibrary>
       <FunctionLevelLinking>true</FunctionLevelLinking>
     <ProjectReference Include="..\console\sci_gateway\cpp\console_gw.vcxproj">
       <Project>{273b1f5c-c137-46d1-b516-ffe5764fabe5}</Project>
     </ProjectReference>
+    <ProjectReference Include="..\console\src\c\console.vcxproj">
+      <Project>{445d3b85-c9b1-498b-9c88-0a3c2390b1cc}</Project>
+    </ProjectReference>
     <ProjectReference Include="..\core\src\cpp\core_gw.vcxproj">
       <Project>{3e933eb6-d427-4828-9b30-b6b9987491f6}</Project>
       <ReferenceOutputAssembly>false</ReferenceOutputAssembly>
index ebbf4c9..1a976f7 100644 (file)
@@ -99,6 +99,7 @@ libscilinear_algebra_la_CPPFLAGS = -I$(srcdir)/includes/ \
 -I$(top_srcdir)/modules/ast/includes \
 -I$(top_srcdir)/modules/output_stream/includes \
 -I$(top_srcdir)/modules/api_scilab/includes \
+-I$(top_srcdir)/modules/console/includes \
 -I$(top_srcdir)/modules/threads/includes \
 -I$(top_srcdir)/modules/system_env/includes \
 -I$(top_srcdir)/modules/string/includes \
index ac7e51c..e545753 100644 (file)
@@ -573,6 +573,7 @@ libscilinear_algebra_la_CPPFLAGS = -I$(srcdir)/includes/ \
 -I$(top_srcdir)/modules/ast/includes \
 -I$(top_srcdir)/modules/output_stream/includes \
 -I$(top_srcdir)/modules/api_scilab/includes \
+-I$(top_srcdir)/modules/console/includes \
 -I$(top_srcdir)/modules/threads/includes \
 -I$(top_srcdir)/modules/system_env/includes \
 -I$(top_srcdir)/modules/string/includes \
index 1748c88..9d3814c 100644 (file)
@@ -76,7 +76,7 @@
   <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
     <ClCompile>
       <Optimization>Disabled</Optimization>
-      <AdditionalIncludeDirectories>../../includes;../../src/cpp;../../../functions_manager/includes;../../../types/includes;../../../symbol/includes;../../../ast/includes;../../../operations/includes;../../../core/includes;../../../output_stream/includes;../../../localization/includes;../../../../libs/intl;../../../../libs/MALLOC/includes;../../../elementary_functions/includes;../../../api_scilab/includes;../../../threads/includes;../../../system_env/includes;../../../string/includes;../../../../libs/dynamiclibrary/includes;../../../../libs/Eigen/includes;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+      <AdditionalIncludeDirectories>../../includes;../../src/cpp;../../../functions_manager/includes;../../../types/includes;../../../symbol/includes;../../../ast/includes;../../../operations/includes;../../../core/includes;../../../output_stream/includes;../../../localization/includes;../../../../libs/intl;../../../../libs/MALLOC/includes;../../../elementary_functions/includes;../../../api_scilab/includes;../../../threads/includes;../../../system_env/includes;../../../string/includes;../../../../libs/dynamiclibrary/includes;../../../../libs/Eigen/includes;../../../console/includes;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
       <PreprocessorDefinitions>WIN32;_DEBUG;_WINDOWS;_USRDLL;LINEAR_ALGEBRA_GW_EXPORTS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
       <MinimalRebuild>true</MinimalRebuild>
       <BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks>
     </Midl>
     <ClCompile>
       <Optimization>Disabled</Optimization>
-      <AdditionalIncludeDirectories>../../includes;../../src/cpp;../../../functions_manager/includes;../../../types/includes;../../../symbol/includes;../../../ast/includes;../../../operations/includes;../../../core/includes;../../../output_stream/includes;../../../localization/includes;../../../../libs/intl;../../../../libs/MALLOC/includes;../../../elementary_functions/includes;../../../api_scilab/includes;../../../threads/includes;../../../system_env/includes;../../../string/includes;../../../../libs/dynamiclibrary/includes;../../../../libs/Eigen/includes;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+      <AdditionalIncludeDirectories>../../includes;../../src/cpp;../../../functions_manager/includes;../../../types/includes;../../../symbol/includes;../../../ast/includes;../../../operations/includes;../../../core/includes;../../../output_stream/includes;../../../localization/includes;../../../../libs/intl;../../../../libs/MALLOC/includes;../../../elementary_functions/includes;../../../api_scilab/includes;../../../threads/includes;../../../system_env/includes;../../../string/includes;../../../../libs/dynamiclibrary/includes;../../../../libs/Eigen/includes;../../../console/includes;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
       <PreprocessorDefinitions>WIN32;_DEBUG;_WINDOWS;_USRDLL;LINEAR_ALGEBRA_GW_EXPORTS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
       <MinimalRebuild>true</MinimalRebuild>
       <BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks>
     <ClCompile>
       <Optimization>MaxSpeed</Optimization>
       <IntrinsicFunctions>true</IntrinsicFunctions>
-      <AdditionalIncludeDirectories>../../includes;../../src/cpp;../../../functions_manager/includes;../../../types/includes;../../../symbol/includes;../../../ast/includes;../../../operations/includes;../../../core/includes;../../../output_stream/includes;../../../localization/includes;../../../../libs/intl;../../../../libs/MALLOC/includes;../../../elementary_functions/includes;../../../api_scilab/includes;../../../threads/includes;../../../system_env/includes;../../../string/includes;../../../../libs/dynamiclibrary/includes;../../../../libs/Eigen/includes;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+      <AdditionalIncludeDirectories>../../includes;../../src/cpp;../../../functions_manager/includes;../../../types/includes;../../../symbol/includes;../../../ast/includes;../../../operations/includes;../../../core/includes;../../../output_stream/includes;../../../localization/includes;../../../../libs/intl;../../../../libs/MALLOC/includes;../../../elementary_functions/includes;../../../api_scilab/includes;../../../threads/includes;../../../system_env/includes;../../../string/includes;../../../../libs/dynamiclibrary/includes;../../../../libs/Eigen/includes;../../../console/includes;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
       <PreprocessorDefinitions>WIN32;NDEBUG;_WINDOWS;_USRDLL;LINEAR_ALGEBRA_GW_EXPORTS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
       <RuntimeLibrary>MultiThreadedDLL</RuntimeLibrary>
       <FunctionLevelLinking>true</FunctionLevelLinking>
     <ClCompile>
       <Optimization>MaxSpeed</Optimization>
       <IntrinsicFunctions>true</IntrinsicFunctions>
-      <AdditionalIncludeDirectories>../../includes;../../src/cpp;../../../functions_manager/includes;../../../types/includes;../../../symbol/includes;../../../ast/includes;../../../operations/includes;../../../core/includes;../../../output_stream/includes;../../../localization/includes;../../../../libs/intl;../../../../libs/MALLOC/includes;../../../elementary_functions/includes;../../../api_scilab/includes;../../../threads/includes;../../../system_env/includes;../../../string/includes;../../../../libs/dynamiclibrary/includes;../../../../libs/Eigen/includes;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+      <AdditionalIncludeDirectories>../../includes;../../src/cpp;../../../functions_manager/includes;../../../types/includes;../../../symbol/includes;../../../ast/includes;../../../operations/includes;../../../core/includes;../../../output_stream/includes;../../../localization/includes;../../../../libs/intl;../../../../libs/MALLOC/includes;../../../elementary_functions/includes;../../../api_scilab/includes;../../../threads/includes;../../../system_env/includes;../../../string/includes;../../../../libs/dynamiclibrary/includes;../../../../libs/Eigen/includes;../../../console/includes;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
       <PreprocessorDefinitions>WIN32;NDEBUG;_WINDOWS;_USRDLL;LINEAR_ALGEBRA_GW_EXPORTS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
       <RuntimeLibrary>MultiThreadedDLL</RuntimeLibrary>
       <FunctionLevelLinking>true</FunctionLevelLinking>
     <ProjectReference Include="..\..\..\ast\ast.vcxproj">
       <Project>{0d3fa25b-8116-44ec-a45e-260789daa3d9}</Project>
     </ProjectReference>
+    <ProjectReference Include="..\..\..\console\src\c\console.vcxproj">
+      <Project>{445d3b85-c9b1-498b-9c88-0a3c2390b1cc}</Project>
+    </ProjectReference>
     <ProjectReference Include="..\..\..\elementary_functions\src\cpp\elem_func\elem_func.vcxproj">
       <Project>{e1284d3e-4b3f-446b-b541-f661a8a166a7}</Project>
     </ProjectReference>
index 24543b5..88be944 100644 (file)
@@ -24,6 +24,7 @@ MEXLIB_FLAGS = \
        -I$(top_srcdir)/modules/system_env/includes \
        -I$(top_srcdir)/modules/threads/includes/ \
        -I$(top_srcdir)/modules/api_scilab/includes/ \
+       -I$(top_srcdir)/modules/console/includes/ \
     -I$(top_srcdir)/libs/dynamiclibrary/includes
 
 if MAINTAINER_MODE
index f9d19b3..6b32440 100644 (file)
@@ -442,6 +442,7 @@ MEXLIB_FLAGS = \
        -I$(top_srcdir)/modules/system_env/includes \
        -I$(top_srcdir)/modules/threads/includes/ \
        -I$(top_srcdir)/modules/api_scilab/includes/ \
+       -I$(top_srcdir)/modules/console/includes/ \
     -I$(top_srcdir)/libs/dynamiclibrary/includes
 
 @MAINTAINER_MODE_TRUE@pkglib_LTLIBRARIES = libmat.la libmex.la libmx.la
index be5aee5..6277c4b 100644 (file)
@@ -1609,7 +1609,8 @@ int mexEvalString(const char *name)
                     std::wostringstream ostr;
                     ostr << L"ans = " << std::endl;
                     ostr << std::endl;
-                    ostr << execMe.result_get()->toString() << std::endl;
+                    execMe.result_get()->toString(ostr);
+                    ostr << std::endl;
                     scilabWriteW(ostr.str().c_str());
                 }
             }
index 79c0ff0..4c3185c 100644 (file)
@@ -1,4 +1,4 @@
-<?xml version="1.0" encoding="utf-8"?>
+<?xml version="1.0" encoding="utf-8"?>
 <Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
   <ItemGroup Label="ProjectConfigurations">
     <ProjectConfiguration Include="Debug|Win32">
@@ -73,7 +73,7 @@
   <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
     <ClCompile>
       <Optimization>Disabled</Optimization>
-      <AdditionalIncludeDirectories>../../../core/includes;../../../string/includes;../../../elementary_functions/includes;../../../output_stream/includes;../../../call_scilab/includes;../../../localization/includes;../../includes;../../../../libs/MALLOC/includes;../../../../libs/intl;../../../types/includes;../../../ast/includes;../../../symbol/includes;../../../parse/includes;../../../system_env/includes;../../../api_scilab/includes;../../../threads/includes;../../../operations/includes;../../../../libs/dynamiclibrary/includes;../../../../libs/Eigen/includes;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+      <AdditionalIncludeDirectories>../../../core/includes;../../../string/includes;../../../elementary_functions/includes;../../../output_stream/includes;../../../call_scilab/includes;../../../localization/includes;../../includes;../../../../libs/MALLOC/includes;../../../../libs/intl;../../../types/includes;../../../ast/includes;../../../symbol/includes;../../../parse/includes;../../../system_env/includes;../../../api_scilab/includes;../../../threads/includes;../../../operations/includes;../../../../libs/dynamiclibrary/includes;../../../../libs/Eigen/includes;../../../console/includes;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
       <PreprocessorDefinitions>mexFunction=mex_libmx;mexfunction_=mexlibmx_;FORDLL;_CRT_SECURE_NO_DEPRECATE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
       <RuntimeLibrary>MultiThreadedDebugDLL</RuntimeLibrary>
       <AssemblerListingLocation>$(Configuration)/</AssemblerListingLocation>
@@ -114,7 +114,7 @@ cd ..
     </Midl>
     <ClCompile>
       <Optimization>Disabled</Optimization>
-      <AdditionalIncludeDirectories>../../../core/includes;../../../string/includes;../../../elementary_functions/includes;../../../output_stream/includes;../../../call_scilab/includes;../../../localization/includes;../../includes;../../../../libs/MALLOC/includes;../../../../libs/intl;../../../types/includes;../../../ast/includes;../../../symbol/includes;../../../parse/includes;../../../system_env/includes;../../../api_scilab/includes;../../../threads/includes;../../../operations/includes;../../../../libs/dynamiclibrary/includes;../../../../libs/Eigen/includes;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+      <AdditionalIncludeDirectories>../../../core/includes;../../../string/includes;../../../elementary_functions/includes;../../../output_stream/includes;../../../call_scilab/includes;../../../localization/includes;../../includes;../../../../libs/MALLOC/includes;../../../../libs/intl;../../../types/includes;../../../ast/includes;../../../symbol/includes;../../../parse/includes;../../../system_env/includes;../../../api_scilab/includes;../../../threads/includes;../../../operations/includes;../../../../libs/dynamiclibrary/includes;../../../../libs/Eigen/includes;../../../console/includes;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
       <PreprocessorDefinitions>mexFunction=mex_libmx;mexfunction_=mexlibmx_;FORDLL;_CRT_SECURE_NO_DEPRECATE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
       <RuntimeLibrary>MultiThreadedDebugDLL</RuntimeLibrary>
       <AssemblerListingLocation>$(Configuration)/</AssemblerListingLocation>
@@ -151,7 +151,7 @@ cd ..
   </ItemDefinitionGroup>
   <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
     <ClCompile>
-      <AdditionalIncludeDirectories>../../../core/includes;../../../string/includes;../../../elementary_functions/includes;../../../output_stream/includes;../../../call_scilab/includes;../../../localization/includes;../../includes;../../../../libs/MALLOC/includes;../../../../libs/intl;../../../types/includes;../../../ast/includes;../../../symbol/includes;../../../parse/includes;../../../system_env/includes;../../../api_scilab/includes;../../../threads/includes;../../../operations/includes;../../../../libs/dynamiclibrary/includes;../../../../libs/Eigen/includes;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+      <AdditionalIncludeDirectories>../../../core/includes;../../../string/includes;../../../elementary_functions/includes;../../../output_stream/includes;../../../call_scilab/includes;../../../localization/includes;../../includes;../../../../libs/MALLOC/includes;../../../../libs/intl;../../../types/includes;../../../ast/includes;../../../symbol/includes;../../../parse/includes;../../../system_env/includes;../../../api_scilab/includes;../../../threads/includes;../../../operations/includes;../../../../libs/dynamiclibrary/includes;../../../../libs/Eigen/includes;../../../console/includes;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
       <PreprocessorDefinitions>mexFunction=mex_libmx;mexfunction_=mexlibmx_;FORDLL;_CRT_SECURE_NO_DEPRECATE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
       <RuntimeLibrary>MultiThreadedDLL</RuntimeLibrary>
       <ObjectFileName>$(Configuration)/</ObjectFileName>
@@ -192,7 +192,7 @@ cd ..
       <TargetEnvironment>X64</TargetEnvironment>
     </Midl>
     <ClCompile>
-      <AdditionalIncludeDirectories>../../../core/includes;../../../string/includes;../../../elementary_functions/includes;../../../output_stream/includes;../../../call_scilab/includes;../../../localization/includes;../../includes;../../../../libs/MALLOC/includes;../../../../libs/intl;../../../types/includes;../../../ast/includes;../../../symbol/includes;../../../parse/includes;../../../system_env/includes;../../../api_scilab/includes;../../../threads/includes;../../../operations/includes;../../../../libs/dynamiclibrary/includes;../../../../libs/Eigen/includes;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+      <AdditionalIncludeDirectories>../../../core/includes;../../../string/includes;../../../elementary_functions/includes;../../../output_stream/includes;../../../call_scilab/includes;../../../localization/includes;../../includes;../../../../libs/MALLOC/includes;../../../../libs/intl;../../../types/includes;../../../ast/includes;../../../symbol/includes;../../../parse/includes;../../../system_env/includes;../../../api_scilab/includes;../../../threads/includes;../../../operations/includes;../../../../libs/dynamiclibrary/includes;../../../../libs/Eigen/includes;../../../console/includes;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
       <PreprocessorDefinitions>mexFunction=mex_libmx;mexfunction_=mexlibmx_;FORDLL;_CRT_SECURE_NO_DEPRECATE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
       <RuntimeLibrary>MultiThreadedDLL</RuntimeLibrary>
       <ObjectFileName>$(Configuration)/</ObjectFileName>
@@ -256,6 +256,8 @@ cd ..
     </ProjectReference>
     <ProjectReference Include="..\..\..\core\src\c\core.vcxproj">
       <Project>{c6e2bc17-34d8-46e4-85f3-6293cb21adcd}</Project>
+    <ProjectReference Include="..\..\..\console\src\c\console.vcxproj">
+      <Project>{445d3b85-c9b1-498b-9c88-0a3c2390b1cc}</Project>
     </ProjectReference>
     <ProjectReference Include="..\..\..\data_structures\src\c\data_structures.vcxproj">
       <Project>{b7a168a0-dfc0-4c6d-b0cc-6079912a4a76}</Project>
index 82c98ef..2cb968b 100644 (file)
@@ -1,4 +1,4 @@
-<?xml version="1.0" encoding="utf-8"?>
+<?xml version="1.0" encoding="utf-8"?>
 <Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
   <ItemGroup Label="ProjectConfigurations">
     <ProjectConfiguration Include="Debug|Win32">
@@ -74,7 +74,7 @@
   <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
     <ClCompile>
       <Optimization>Disabled</Optimization>
-      <AdditionalIncludeDirectories>../../../core/includes;../../../string/includes;../../../elementary_functions/includes;../../../output_stream/includes;../../../call_scilab/includes;../../../localization/includes;../../includes;../../../../libs/MALLOC/includes;../../../../libs/intl;../../../types/includes;../../../ast/includes;../../../symbol/includes;../../../parse/includes;../../../system_env/includes;../../../api_scilab/includes;../../../threads/includes;../../../operations/includes;../../../../libs/dynamiclibrary/includes;../../../../libs/Eigen/includes;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+      <AdditionalIncludeDirectories>../../../core/includes;../../../string/includes;../../../elementary_functions/includes;../../../output_stream/includes;../../../call_scilab/includes;../../../localization/includes;../../includes;../../../../libs/MALLOC/includes;../../../../libs/intl;../../../types/includes;../../../ast/includes;../../../symbol/includes;../../../parse/includes;../../../system_env/includes;../../../api_scilab/includes;../../../threads/includes;../../../operations/includes;../../../../libs/dynamiclibrary/includes;../../../../libs/Eigen/includes;../../../console/includes;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
       <PreprocessorDefinitions>mexFunction=mex_libmx;mexfunction_=mexlibmx_;FORDLL;_CRT_SECURE_NO_DEPRECATE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
       <RuntimeLibrary>MultiThreadedDebugDLL</RuntimeLibrary>
       <AssemblerListingLocation>$(Configuration)/</AssemblerListingLocation>
@@ -115,7 +115,7 @@ cd ..
     </Midl>
     <ClCompile>
       <Optimization>Disabled</Optimization>
-      <AdditionalIncludeDirectories>../../../core/includes;../../../string/includes;../../../elementary_functions/includes;../../../output_stream/includes;../../../call_scilab/includes;../../../localization/includes;../../includes;../../../../libs/MALLOC/includes;../../../../libs/intl;../../../types/includes;../../../ast/includes;../../../symbol/includes;../../../parse/includes;../../../system_env/includes;../../../api_scilab/includes;../../../threads/includes;../../../operations/includes;../../../../libs/dynamiclibrary/includes;../../../../libs/Eigen/includes;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+      <AdditionalIncludeDirectories>../../../core/includes;../../../string/includes;../../../elementary_functions/includes;../../../output_stream/includes;../../../call_scilab/includes;../../../localization/includes;../../includes;../../../../libs/MALLOC/includes;../../../../libs/intl;../../../types/includes;../../../ast/includes;../../../symbol/includes;../../../parse/includes;../../../system_env/includes;../../../api_scilab/includes;../../../threads/includes;../../../operations/includes;../../../../libs/dynamiclibrary/includes;../../../../libs/Eigen/includes;../../../console/includes;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
       <PreprocessorDefinitions>mexFunction=mex_libmx;mexfunction_=mexlibmx_;FORDLL;_CRT_SECURE_NO_DEPRECATE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
       <RuntimeLibrary>MultiThreadedDebugDLL</RuntimeLibrary>
       <AssemblerListingLocation>$(Configuration)/</AssemblerListingLocation>
@@ -152,7 +152,7 @@ cd ..
   </ItemDefinitionGroup>
   <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
     <ClCompile>
-      <AdditionalIncludeDirectories>../../../core/includes;../../../string/includes;../../../elementary_functions/includes;../../../output_stream/includes;../../../call_scilab/includes;../../../localization/includes;../../includes;../../../../libs/MALLOC/includes;../../../../libs/intl;../../../types/includes;../../../ast/includes;../../../symbol/includes;../../../parse/includes;../../../system_env/includes;../../../api_scilab/includes;../../../threads/includes;../../../operations/includes;../../../../libs/dynamiclibrary/includes;../../../../libs/Eigen/includes;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+      <AdditionalIncludeDirectories>../../../core/includes;../../../string/includes;../../../elementary_functions/includes;../../../output_stream/includes;../../../call_scilab/includes;../../../localization/includes;../../includes;../../../../libs/MALLOC/includes;../../../../libs/intl;../../../types/includes;../../../ast/includes;../../../symbol/includes;../../../parse/includes;../../../system_env/includes;../../../api_scilab/includes;../../../threads/includes;../../../operations/includes;../../../../libs/dynamiclibrary/includes;../../../../libs/Eigen/includes;../../../console/includes;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
       <PreprocessorDefinitions>mexFunction=mex_libmx;mexfunction_=mexlibmx_;FORDLL;_CRT_SECURE_NO_DEPRECATE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
       <RuntimeLibrary>MultiThreadedDLL</RuntimeLibrary>
       <WarningLevel>Level3</WarningLevel>
@@ -192,7 +192,7 @@ cd ..
       <TargetEnvironment>X64</TargetEnvironment>
     </Midl>
     <ClCompile>
-      <AdditionalIncludeDirectories>../../../core/includes;../../../string/includes;../../../elementary_functions/includes;../../../output_stream/includes;../../../call_scilab/includes;../../../localization/includes;../../includes;../../../../libs/MALLOC/includes;../../../../libs/intl;../../../api_scilab/includes;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+      <AdditionalIncludeDirectories>../../../core/includes;../../../string/includes;../../../elementary_functions/includes;../../../output_stream/includes;../../../call_scilab/includes;../../../localization/includes;../../includes;../../../../libs/MALLOC/includes;../../../../libs/intl;../../../types/includes;../../../ast/includes;../../../symbol/includes;../../../parse/includes;../../../system_env/includes;../../../api_scilab/includes;../../../threads/includes;../../../operations/includes;../../../../libs/dynamiclibrary/includes;../../../../libs/Eigen/includes;../../../console/includes;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
       <PreprocessorDefinitions>mexFunction=mex_libmx;mexfunction_=mexlibmx_;FORDLL;_CRT_SECURE_NO_DEPRECATE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
       <RuntimeLibrary>MultiThreadedDLL</RuntimeLibrary>
       <WarningLevel>Level3</WarningLevel>
@@ -263,6 +263,8 @@ cd ..
     </ProjectReference>
     <ProjectReference Include="..\..\..\core\src\c\core.vcxproj">
       <Project>{c6e2bc17-34d8-46e4-85f3-6293cb21adcd}</Project>
+    <ProjectReference Include="..\..\..\console\src\c\console.vcxproj">
+      <Project>{445d3b85-c9b1-498b-9c88-0a3c2390b1cc}</Project>
     </ProjectReference>
     <ProjectReference Include="..\..\..\data_structures\src\c\data_structures.vcxproj">
       <Project>{b7a168a0-dfc0-4c6d-b0cc-6079912a4a76}</Project>
index 24aa6e3..5e05de5 100644 (file)
@@ -1,4 +1,4 @@
-<?xml version="1.0" encoding="utf-8"?>
+<?xml version="1.0" encoding="utf-8"?>
 <Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
   <ItemGroup Label="ProjectConfigurations">
     <ProjectConfiguration Include="Debug|Win32">
@@ -74,7 +74,7 @@
   <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
     <ClCompile>
       <Optimization>Disabled</Optimization>
-      <AdditionalIncludeDirectories>../../../core/includes;../../../string/includes;../../../elementary_functions/includes;../../../output_stream/includes;../../../call_scilab/includes;../../../localization/includes;../../includes;../../../../libs/MALLOC/includes;../../../../libs/intl;../../../types/includes;../../../ast/includes;../../../symbol/includes;../../../parse/includes;../../../system_env/includes;../../../api_scilab/includes;../../../threads/includes;../../../operations/includes;../../../../libs/dynamiclibrary/includes;../../../../libs/Eigen/includes;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+      <AdditionalIncludeDirectories>../../../core/includes;../../../string/includes;../../../elementary_functions/includes;../../../output_stream/includes;../../../call_scilab/includes;../../../localization/includes;../../includes;../../../../libs/MALLOC/includes;../../../../libs/intl;../../../types/includes;../../../ast/includes;../../../symbol/includes;../../../parse/includes;../../../system_env/includes;../../../api_scilab/includes;../../../threads/includes;../../../operations/includes;../../../../libs/dynamiclibrary/includes;../../../../libs/Eigen/includes;../../../console/includes;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
       <PreprocessorDefinitions>mexFunction=mex_libmx;mexfunction_=mexlibmx_;FORDLL;_CRT_SECURE_NO_DEPRECATE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
       <RuntimeLibrary>MultiThreadedDebugDLL</RuntimeLibrary>
       <AssemblerListingLocation>$(Configuration)/</AssemblerListingLocation>
@@ -115,7 +115,7 @@ cd ..
     </Midl>
     <ClCompile>
       <Optimization>Disabled</Optimization>
-      <AdditionalIncludeDirectories>../../../core/includes;../../../string/includes;../../../elementary_functions/includes;../../../output_stream/includes;../../../call_scilab/includes;../../../localization/includes;../../includes;../../../../libs/MALLOC/includes;../../../../libs/intl;../../../types/includes;../../../ast/includes;../../../symbol/includes;../../../parse/includes;../../../system_env/includes;../../../api_scilab/includes;../../../threads/includes;../../../operations/includes;../../../../libs/dynamiclibrary/includes;../../../../libs/Eigen/includes;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+      <AdditionalIncludeDirectories>../../../core/includes;../../../string/includes;../../../elementary_functions/includes;../../../output_stream/includes;../../../call_scilab/includes;../../../localization/includes;../../includes;../../../../libs/MALLOC/includes;../../../../libs/intl;../../../types/includes;../../../ast/includes;../../../symbol/includes;../../../parse/includes;../../../system_env/includes;../../../api_scilab/includes;../../../threads/includes;../../../operations/includes;../../../../libs/dynamiclibrary/includes;../../../../libs/Eigen/includes;../../../console/includes;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
       <PreprocessorDefinitions>mexFunction=mex_libmx;mexfunction_=mexlibmx_;FORDLL;_CRT_SECURE_NO_DEPRECATE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
       <RuntimeLibrary>MultiThreadedDebugDLL</RuntimeLibrary>
       <AssemblerListingLocation>$(Configuration)/</AssemblerListingLocation>
@@ -152,7 +152,7 @@ cd ..
   </ItemDefinitionGroup>
   <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
     <ClCompile>
-      <AdditionalIncludeDirectories>../../../core/includes;../../../string/includes;../../../elementary_functions/includes;../../../output_stream/includes;../../../call_scilab/includes;../../../localization/includes;../../includes;../../../../libs/MALLOC/includes;../../../../libs/intl;../../../types/includes;../../../ast/includes;../../../symbol/includes;../../../parse/includes;../../../system_env/includes;../../../api_scilab/includes;../../../threads/includes;../../../operations/includes;../../../../libs/dynamiclibrary/includes;../../../../libs/Eigen/includes;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+      <AdditionalIncludeDirectories>../../../core/includes;../../../string/includes;../../../elementary_functions/includes;../../../output_stream/includes;../../../call_scilab/includes;../../../localization/includes;../../includes;../../../../libs/MALLOC/includes;../../../../libs/intl;../../../types/includes;../../../ast/includes;../../../symbol/includes;../../../parse/includes;../../../system_env/includes;../../../api_scilab/includes;../../../threads/includes;../../../operations/includes;../../../../libs/dynamiclibrary/includes;../../../../libs/Eigen/includes;../../../console/includes;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
       <PreprocessorDefinitions>mexFunction=mex_libmx;mexfunction_=mexlibmx_;FORDLL;_CRT_SECURE_NO_DEPRECATE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
       <RuntimeLibrary>MultiThreadedDLL</RuntimeLibrary>
       <ObjectFileName>$(Configuration)/</ObjectFileName>
@@ -193,7 +193,7 @@ cd ..
       <TargetEnvironment>X64</TargetEnvironment>
     </Midl>
     <ClCompile>
-      <AdditionalIncludeDirectories>../../../core/includes;../../../string/includes;../../../elementary_functions/includes;../../../output_stream/includes;../../../call_scilab/includes;../../../localization/includes;../../includes;../../../../libs/MALLOC/includes;../../../../libs/intl;../../../types/includes;../../../ast/includes;../../../symbol/includes;../../../parse/includes;../../../system_env/includes;../../../api_scilab/includes;../../../threads/includes;../../../operations/includes;../../../../libs/dynamiclibrary/includes;../../../../libs/Eigen/includes;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+      <AdditionalIncludeDirectories>../../../core/includes;../../../string/includes;../../../elementary_functions/includes;../../../output_stream/includes;../../../call_scilab/includes;../../../localization/includes;../../includes;../../../../libs/MALLOC/includes;../../../../libs/intl;../../../types/includes;../../../ast/includes;../../../symbol/includes;../../../parse/includes;../../../system_env/includes;../../../api_scilab/includes;../../../threads/includes;../../../operations/includes;../../../../libs/dynamiclibrary/includes;../../../../libs/Eigen/includes;../../../console/includes;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
       <PreprocessorDefinitions>mexFunction=mex_libmx;mexfunction_=mexlibmx_;FORDLL;_CRT_SECURE_NO_DEPRECATE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
       <RuntimeLibrary>MultiThreadedDLL</RuntimeLibrary>
       <ObjectFileName>$(Configuration)/</ObjectFileName>
@@ -257,6 +257,8 @@ cd ..
     </ProjectReference>
     <ProjectReference Include="..\..\..\core\src\c\core.vcxproj">
       <Project>{c6e2bc17-34d8-46e4-85f3-6293cb21adcd}</Project>
+    <ProjectReference Include="..\..\..\console\src\c\console.vcxproj">
+      <Project>{445d3b85-c9b1-498b-9c88-0a3c2390b1cc}</Project>
     </ProjectReference>
     <ProjectReference Include="..\..\..\data_structures\src\c\data_structures.vcxproj">
       <Project>{b7a168a0-dfc0-4c6d-b0cc-6079912a4a76}</Project>
index b522511..8d706dd 100644 (file)
@@ -76,7 +76,7 @@
   <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
     <ClCompile>
       <Optimization>Disabled</Optimization>
-      <AdditionalIncludeDirectories>..\..\..\includes;..\..\..\..\functions_manager\includes;..\..\..\..\types\includes;..\..\..\..\core\includes;..\..\..\..\symbol\includes;..\..\..\..\ast\includes;../../../../system_env/includes;../../../../localization/includes;../../../../../libs/intl;../../../../../libs/MALLOC/includes;../../../../string/includes;../../../src/cpp;../../../../api_scilab/includes;../../../../operations/includes;../../../../threads/includes;../../../../../libs/dynamiclibrary/includes;../../../../../libs/Eigen/includes;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+      <AdditionalIncludeDirectories>..\..\..\includes;..\..\..\..\functions_manager\includes;..\..\..\..\types\includes;..\..\..\..\core\includes;..\..\..\..\symbol\includes;..\..\..\..\ast\includes;../../../../system_env/includes;../../../../localization/includes;../../../../../libs/intl;../../../../../libs/MALLOC/includes;../../../../string/includes;../../../src/cpp;../../../../api_scilab/includes;../../../../operations/includes;../../../../threads/includes;../../../../../libs/dynamiclibrary/includes;../../../../../libs/Eigen/includes;../../../../console/includes;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
       <PreprocessorDefinitions>WIN32;_DEBUG;_WINDOWS;_USRDLL;OUTPUT_STREAM_GW_EXPORTS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
       <MinimalRebuild>true</MinimalRebuild>
       <BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks>
     </Midl>
     <ClCompile>
       <Optimization>Disabled</Optimization>
-      <AdditionalIncludeDirectories>..\..\..\includes;..\..\..\..\functions_manager\includes;..\..\..\..\types\includes;..\..\..\..\core\includes;..\..\..\..\symbol\includes;..\..\..\..\ast\includes;../../../../system_env/includes;../../../../localization/includes;../../../../../libs/intl;../../../../../libs/MALLOC/includes;../../../../string/includes;../../../src/cpp;../../../../api_scilab/includes;../../../../operations/includes;../../../../threads/includes;../../../../../libs/dynamiclibrary/includes;../../../../../libs/Eigen/includes;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+      <AdditionalIncludeDirectories>..\..\..\includes;..\..\..\..\functions_manager\includes;..\..\..\..\types\includes;..\..\..\..\core\includes;..\..\..\..\symbol\includes;..\..\..\..\ast\includes;../../../../system_env/includes;../../../../localization/includes;../../../../../libs/intl;../../../../../libs/MALLOC/includes;../../../../string/includes;../../../src/cpp;../../../../api_scilab/includes;../../../../operations/includes;../../../../threads/includes;../../../../../libs/dynamiclibrary/includes;../../../../../libs/Eigen/includes;../../../../console/includes;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
       <PreprocessorDefinitions>WIN32;_DEBUG;_WINDOWS;_USRDLL;OUTPUT_STREAM_GW_EXPORTS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
       <MinimalRebuild>true</MinimalRebuild>
       <BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks>
     <ClCompile>
       <Optimization>MaxSpeed</Optimization>
       <IntrinsicFunctions>true</IntrinsicFunctions>
-      <AdditionalIncludeDirectories>..\..\..\includes;..\..\..\..\functions_manager\includes;..\..\..\..\types\includes;..\..\..\..\core\includes;..\..\..\..\symbol\includes;..\..\..\..\ast\includes;../../../../system_env/includes;../../../../localization/includes;../../../../../libs/intl;../../../../../libs/MALLOC/includes;../../../../string/includes;../../../src/cpp;../../../../api_scilab/includes;../../../../operations/includes;../../../../threads/includes;../../../../../libs/dynamiclibrary/includes;../../../../../libs/Eigen/includes;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+      <AdditionalIncludeDirectories>..\..\..\includes;..\..\..\..\functions_manager\includes;..\..\..\..\types\includes;..\..\..\..\core\includes;..\..\..\..\symbol\includes;..\..\..\..\ast\includes;../../../../system_env/includes;../../../../localization/includes;../../../../../libs/intl;../../../../../libs/MALLOC/includes;../../../../string/includes;../../../src/cpp;../../../../api_scilab/includes;../../../../operations/includes;../../../../threads/includes;../../../../../libs/dynamiclibrary/includes;../../../../../libs/Eigen/includes;../../../../console/includes;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
       <PreprocessorDefinitions>WIN32;NDEBUG;_WINDOWS;_USRDLL;OUTPUT_STREAM_GW_EXPORTS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
       <RuntimeLibrary>MultiThreadedDLL</RuntimeLibrary>
       <FunctionLevelLinking>true</FunctionLevelLinking>
     <ClCompile>
       <Optimization>MaxSpeed</Optimization>
       <IntrinsicFunctions>true</IntrinsicFunctions>
-      <AdditionalIncludeDirectories>..\..\..\includes;..\..\..\..\functions_manager\includes;..\..\..\..\types\includes;..\..\..\..\core\includes;..\..\..\..\symbol\includes;..\..\..\..\ast\includes;../../../../system_env/includes;../../../../localization/includes;../../../../../libs/intl;../../../../../libs/MALLOC/includes;../../../../string/includes;../../../src/cpp;../../../../api_scilab/includes;../../../../operations/includes;../../../../threads/includes;../../../../../libs/dynamiclibrary/includes;../../../../../libs/Eigen/includes;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+      <AdditionalIncludeDirectories>..\..\..\includes;..\..\..\..\functions_manager\includes;..\..\..\..\types\includes;..\..\..\..\core\includes;..\..\..\..\symbol\includes;..\..\..\..\ast\includes;../../../../system_env/includes;../../../../localization/includes;../../../../../libs/intl;../../../../../libs/MALLOC/includes;../../../../string/includes;../../../src/cpp;../../../../api_scilab/includes;../../../../operations/includes;../../../../threads/includes;../../../../../libs/dynamiclibrary/includes;../../../../../libs/Eigen/includes;../../../../console/includes;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
       <PreprocessorDefinitions>WIN32;NDEBUG;_WINDOWS;_USRDLL;OUTPUT_STREAM_GW_EXPORTS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
       <RuntimeLibrary>MultiThreadedDLL</RuntimeLibrary>
       <FunctionLevelLinking>true</FunctionLevelLinking>
       <Project>{43c5bab1-1dca-4743-a183-77e0d42fe7d0}</Project>
       <ReferenceOutputAssembly>false</ReferenceOutputAssembly>
     </ProjectReference>
+    <ProjectReference Include="..\..\..\..\console\src\c\console.vcxproj">
+      <Project>{445d3b85-c9b1-498b-9c88-0a3c2390b1cc}</Project>
+    </ProjectReference>
     <ProjectReference Include="..\..\..\..\core\src\c\core.vcxproj">
       <Project>{c6e2bc17-34d8-46e4-85f3-6293cb21adcd}</Project>
       <ReferenceOutputAssembly>false</ReferenceOutputAssembly>
index be07def..6f60775 100644 (file)
@@ -36,8 +36,10 @@ Function::ReturnValue sci_disp(typed_list &in, int _piRetCount, typed_list &out)
 
        for(it = in.rbegin() ; it != in.rend() ; it++)
        {
+        std::wostringstream ostr;
+        (*it)->toString(ostr);
         scilabForcedWriteW(L"\n");
-               scilabForcedWriteW((*it)->toString().c_str());
+               scilabForcedWriteW(ostr.str().c_str());
        }
 
        scilabForcedWriteW(L"\n");
index 1e3243c..3818514 100644 (file)
@@ -144,7 +144,9 @@ Function::ReturnValue sci_string(typed_list &in, int _iRetCount, typed_list &out
         }
     default :
         {
-            out.push_back(new types::String((in[0]->toString()).c_str()));
+            std::wostringstream ostr;
+            in[0]->toString(ostr);
+            out.push_back(new types::String(ostr.str().c_str()));
             break;
         }
     }
index 0538e16..a033202 100644 (file)
@@ -206,7 +206,7 @@ int ConfigVariable::getConsoleWidth(void)
 ** \{
 */
 
-int ConfigVariable::m_iConsoleLines = 28; //console lines default value
+int ConfigVariable::m_iConsoleLines = 0; //console lines default value
 
 void ConfigVariable::setConsoleLines(int _iConsoleLines)
 {
index cc97357..b2d578a 100644 (file)
@@ -46,12 +46,15 @@ namespace types
         T*                      m_pRealData;
         T*                      m_pImgData;
 
+
                                 ArrayOf() : GenericType(), m_bComplex(false), m_pRealData(NULL), m_pImgData(NULL) {}
+
         virtual                 ~ArrayOf()
         {
             //delete[] m_piDims;
         }
 
+
         /*internal constructor*/
         void create(int* _piDims, int _iDims, T** _pRealData, T** _pImgData)
         {
@@ -1402,21 +1405,21 @@ namespace types
                    return pOut;
            }
 
-        virtual std::wstring toString()
+        virtual bool toString(std::wostringstream& ostr)
         {
-            std::wostringstream ostr;
             int* piDims = new int[m_iDims];
-
-            parseSubMatrix(ostr, piDims, m_iDims, m_iDims - 1);
-            return ostr.str();
+            bool bFinish = parseSubMatrix(ostr, piDims, m_iDims, m_iDims - 1);
+            delete[] piDims;
+            return bFinish;
         }
 
-        void parseSubMatrix(std::wostringstream& ostr, int* _piDims, int _iDims, int _iDim)
+        bool parseSubMatrix(std::wostringstream& ostr, int* _piDims, int _iDims, int _iDim)
         {
+            bool bFinish = false;
             if(_iDim == 1)
             {//we have reach 2-dim matrix
 
-                if(m_iDims > 2)
+                if(m_iDims > 2 && m_bPrintFromStart)
                 {//only print for dims > 2
                     ostr << L"(:,:";
                     for(int i = 2 ; i < _iDims ; i++)
@@ -1426,20 +1429,43 @@ namespace types
                     ostr << L")" << std::endl << std::endl;
                 }
 
-                subMatrixToString(ostr, _piDims, _iDims);
+                //reset flag to print dims on next call
+                m_bPrintFromStart = true;
+
+                bFinish = subMatrixToString(ostr, _piDims, _iDims);
+                if(bFinish == false)
+                {//save print status
+                    m_bPrintFromStart = false;
+                    return false;
+                }
             }
             else
             {//draw, continue to dig
-                for(int i = 0 ; i < m_piDims[_iDim] ; i++)
+                for(int i = m_iSavePrintState ; i < m_piDims[_iDim] ; i++)
                 {
                     _piDims[_iDim] = i;
-                    parseSubMatrix(ostr, _piDims, _iDims, _iDim - 1);
+                    bFinish = parseSubMatrix(ostr, _piDims, _iDims, _iDim - 1);
+                    if(bFinish == false)
+                    {//save print status
+                        m_iSavePrintState = i;
+                        return false;
+                    }
                 }
+
+                //reset state to print from state
+                m_iSavePrintState = 0;
+                m_iRows1PrintState = 0;
+                m_iCols1PrintState = 0;
+                m_iRows2PrintState = 0;
+                m_iCols2PrintState = 0;
             }
+
+            return true;
         }
 
-        virtual void subMatrixToString(std::wostringstream& ostr, int* _piDims, int _iDims)
+        virtual bool subMatrixToString(std::wostringstream& ostr, int* _piDims, int _iDims)
         {
+            return true;
         }
 
         virtual std::wstring toStringInLine()
index 1bebd7f..52baad8 100644 (file)
@@ -60,7 +60,7 @@ namespace types
         RealType                               getType(void);
 
     private :
-        virtual void            subMatrixToString(std::wostringstream& ostr, int* _piDims, int _iDims);
+        virtual bool            subMatrixToString(std::wostringstream& ostr, int* _piDims, int _iDims);
 
         virtual int             getNullValue();
         virtual Bool*           createEmpty(int _iDims, int* _piDims, bool _bComplex = false);
index 7099bb2..2f987e2 100644 (file)
@@ -73,7 +73,7 @@ namespace types
         /* return type as short string ( s, i, ce, l, ... )*/
         virtual std::wstring getShortTypeStr() {return L"ce";};
         virtual bool        isContainer(void) { return true; }
-        void                subMatrixToString(std::wostringstream& ostr, int* _piDims, int _iDims);
+        bool                subMatrixToString(std::wostringstream& ostr, int* _piDims, int _iDims);
 
     private :
         virtual InternalType*   getNullValue();
index f09c9c3..7f27539 100644 (file)
@@ -74,7 +74,7 @@ namespace types
         RealType                    getType(void);
 
     private :
-        virtual void                subMatrixToString(std::wostringstream& ostr, int* _piDims, int _iDims);
+        virtual bool                subMatrixToString(std::wostringstream& ostr, int* _piDims, int _iDims);
 
         virtual double              getNullValue();
         virtual Double*             createEmpty(int _iDims, int* _piDims, bool _bComplex = false);
index f42f99f..70f603e 100644 (file)
@@ -69,7 +69,7 @@ namespace types
 
         /*Internal "constructor*/
         void                createFloat(int _iRows, int _iCols, float **_pfReal, float **_pfImg);
-        std::wstring        toString();
+        bool                toString(std::wostringstream& ostr);
 
         bool                operator==(const InternalType& it);
         bool                operator!=(const InternalType& it);
index 72c0bc4..f78740f 100644 (file)
@@ -71,7 +71,7 @@ namespace types
 
         void                    whoAmI();
 
-        std::wstring            toString();
+        bool                    toString(std::wostringstream& ostr);
 
         virtual ReturnValue     call(typed_list &in, int _iRetCount, typed_list &out, ast::ConstVisitor* execFunc);
 
index af353d4..b87f997 100644 (file)
@@ -40,7 +40,7 @@ namespace types
 
         bool isSingleHandle();
 
-        std::wstring toString();
+        bool toString(std::wostringstream& ostr);
 
         /* return type as string ( double, int, cell, list, ... )*/
         virtual std::wstring getTypeStr() {return L"handle";}
@@ -79,7 +79,7 @@ namespace types
         RealType                               getType(void);
 
     private :
-        virtual void            subMatrixToString(std::wostringstream& ostr, int* _piDims, int _iDims);
+        virtual bool            subMatrixToString(std::wostringstream& ostr, int* _piDims, int _iDims);
 
         virtual SingleHandle*   getNullValue();
         virtual GraphicHandle*  createEmpty(int _iDims, int* _piDims, bool _bComplex = false);
index 245a6b0..fb3f737 100644 (file)
@@ -74,7 +74,7 @@ namespace types
         bool                    compute();
         bool                    isComputable();
 
-        std::wstring            toString();
+        bool                    toString(std::wostringstream& ostr);
 
 
         InternalType::RealType  getStartType();
index c715647..f09d27a 100644 (file)
@@ -57,7 +57,7 @@ namespace types
         RealType                                   getType(void){return InternalType::RealInt16;}
 
     private :
-        virtual void                subMatrixToString(std::wostringstream& ostr, int* _piDims, int _iDims);
+        virtual bool                subMatrixToString(std::wostringstream& ostr, int* _piDims, int _iDims);
 
         virtual short               getNullValue();
         virtual Int16*              createEmpty(int _iDims, int* _piDims, bool _bComplex = false);
index 8261d5a..4a1c830 100644 (file)
@@ -57,7 +57,7 @@ namespace types
         RealType                                   getType(void){return InternalType::RealInt32;}
 
     private :
-        virtual void                subMatrixToString(std::wostringstream& ostr, int* _piDims, int _iDims);
+        virtual bool                subMatrixToString(std::wostringstream& ostr, int* _piDims, int _iDims);
 
         virtual int                 getNullValue();
         virtual Int32*              createEmpty(int _iDims, int* _piDims, bool _bComplex = false);
index 4134399..aaf53f3 100644 (file)
@@ -57,7 +57,7 @@ namespace types
         RealType                                   getType(void){return InternalType::RealInt64;}
 
     private :
-        virtual void                subMatrixToString(std::wostringstream& ostr, int* _piDims, int _iDims);
+        virtual bool                subMatrixToString(std::wostringstream& ostr, int* _piDims, int _iDims);
 
         virtual long long           getNullValue();
         virtual Int64*              createEmpty(int _iDims, int* _piDims, bool _bComplex = false);
index 1216b7a..9ab8989 100644 (file)
@@ -57,7 +57,7 @@ namespace types
         RealType                                   getType(void){return InternalType::RealInt8;}
 
     private :
-        virtual void                subMatrixToString(std::wostringstream& ostr, int* _piDims, int _iDims);
+        virtual bool                subMatrixToString(std::wostringstream& ostr, int* _piDims, int _iDims);
 
         virtual char                getNullValue();
         virtual Int8*               createEmpty(int _iDims, int* _piDims, bool _bComplex = false);
index e2f038a..78d3179 100644 (file)
@@ -79,7 +79,7 @@ namespace types
         };
 
     protected :
-        InternalType() : m_iRef(0), m_bAllowDelete(true) {}
+        InternalType() : m_iRef(0), m_bAllowDelete(true),m_bPrintFromStart(true), m_iSavePrintState(0), m_iRows1PrintState(0), m_iRows2PrintState(0), m_iCols1PrintState(0), m_iCols2PrintState(0) {}
 
     public :
         virtual                         ~InternalType(){};
@@ -89,7 +89,8 @@ namespace types
         virtual RealType                getType(void) = 0 ; //{ return RealInternal; }
 
 
-        virtual std::wstring           toString() = 0;
+        virtual bool                    toString(std::wostringstream& ostr) = 0;
+
         virtual std::wstring            toStringInLine()
         {
             return getTypeStr();
@@ -170,10 +171,30 @@ namespace types
         virtual bool                    isListInsert(void) { return false; }
         virtual bool                    isListUndefined(void) { return false; }
 
+        void clearPrintState()
+        {
+            m_bPrintFromStart = true;
+            m_iSavePrintState = 0;
+            m_iRows1PrintState = 0;
+            m_iCols1PrintState = 0;
+            m_iRows2PrintState = 0;
+            m_iCols2PrintState = 0;
+        }
+
+
     protected :
         int                             m_iRef;
         //use to know if we can delete this variables or if it's link to a scilab variable.
         bool                            m_bAllowDelete;
+
+        /*variables to manage print taking care of lines*/
+        bool                    m_bPrintFromStart;
+        int                     m_iSavePrintState;
+        int                     m_iRows1PrintState;
+        int                     m_iCols1PrintState;
+        int                     m_iRows2PrintState;
+        int                     m_iCols2PrintState;
+
     };
 
     /*
index 54b55a0..8ec0231 100644 (file)
@@ -50,7 +50,7 @@ namespace types
 
         GenericType*                    getColumnValues(int _iPos);
 
-        std::wstring                    toString();
+        bool                            toString(std::wostringstream& ostr);
 
         bool                            isList() { return true; }
 
index 5fa855e..b0d1ba3 100644 (file)
@@ -33,7 +33,7 @@ namespace types
 
         void                    whoAmI();
 
-        std::wstring            toString();
+        bool                    toString(std::wostringstream& ostr);
 
         /* return type as string ( double, int, cell, list, ... )*/
         virtual std::wstring    getTypeStr() {return L"listdelete";}
index 3b2e411..6f18f57 100644 (file)
@@ -32,7 +32,7 @@ namespace types
 
         void                    whoAmI();
 
-        std::wstring            toString();
+        bool                    toString(std::wostringstream& ostr);
         InternalType*           getInsert();
 
         /* return type as string ( double, int, cell, list, ... )*/
index f163214..03b31b1 100644 (file)
@@ -32,7 +32,7 @@ namespace types
 
         void                    whoAmI();
 
-        std::wstring            toString();
+        bool                    toString(std::wostringstream& ostr);
         virtual bool            isAssignable(void) { return false; }
 
         /* return type as string ( double, int, cell, list, ... )*/
index edef6ff..b71668a 100644 (file)
@@ -33,7 +33,7 @@ namespace types
 
         void                    whoAmI();
 
-        std::wstring            toString();
+        bool                    toString(std::wostringstream& ostr);
 
         /* return type as string ( double, int, cell, list, ... )*/
         virtual std::wstring    getTypeStr() {return L"listundefined";}
index 0ba67d7..1ca41cd 100644 (file)
@@ -37,7 +37,7 @@ namespace types
 
         void                        whoAmI();
 
-        wstring                     toString();
+        bool                        toString(std::wostringstream& ostr);
 
         Callable::ReturnValue       call(typed_list &in, int _iRetCount, typed_list &out, ast::ConstVisitor* execFunc);
 
index 68acef1..84e6698 100644 (file)
@@ -34,7 +34,7 @@ namespace types
 
         void                    whoAmI();
 
-        wstring                 toString();
+        bool                    toString(std::wostringstream& ostr);
 
         Callable::ReturnValue   call(typed_list &in, int _iRetCount, typed_list &out, ast::ConstVisitor* execFunc);
         bool                    parse(void);
index 046d301..4200dfa 100644 (file)
@@ -80,7 +80,7 @@ namespace types
         std::wstring            m_szVarName;
 
     private :
-        virtual void            subMatrixToString(std::wostringstream& ostr, int* _piDims, int _iDims);
+        virtual bool            subMatrixToString(std::wostringstream& ostr, int* _piDims, int _iDims);
 
         virtual SinglePoly*     getNullValue();
         virtual Polynom*        createEmpty(int _iDims, int* _piDims, bool _bComplex = false);
index 9ca02b3..57ac0b7 100644 (file)
@@ -57,7 +57,7 @@ namespace types
         void                    toStringReal(std::wstring _szVar, std::list<std::wstring>* _pListExp , std::list<std::wstring>* _pListCoef);
         void                    toStringImg(std::wstring _szVar, std::list<std::wstring>* _pListExp , std::list<std::wstring>* _pListCoef);
 
-        std::wstring            toString();
+        bool                    toString(std::wostringstream& ostr);
 
         bool                    operator==(const InternalType& it);
         bool                    operator!=(const InternalType& it);
index 271e882..16e363f 100644 (file)
@@ -37,7 +37,7 @@ namespace types
 
         RealType                                getType(void) {return RealSingleStruct;}
 
-        std::wstring                            toString();
+        bool                                    toString(std::wostringstream& ostr);
 
         bool                                    set(const std::wstring& _sKey, InternalType *_typedValue);
         InternalType*                           get(const std::wstring& _sKey);
index 6c4d756..eb97fef 100644 (file)
@@ -120,9 +120,9 @@ namespace types
         bool isExtract() const;
         Sparse* clone(void) const;
         Sparse* clone(void) { return const_cast<Sparse const*>(this)->clone();}
-        std::wstring toString() const;
-        std::wstring toString()
-        { return const_cast<Sparse const*>(this)->toString(); }
+        bool toString(std::wostringstream& ostr) const;
+        bool toString(std::wostringstream& ostr)
+        { return const_cast<Sparse const*>(this)->toString(ostr); }
 
         /* post condition: dimensions are at least _iNewRows, _iNewCols
            preserving existing data.
@@ -453,9 +453,9 @@ namespace types
         SparseBool(SparseBool const& o);
 
         bool isSparseBool(){return true;}
-        std::wstring toString() const;
-        std::wstring toString()
-        { return const_cast<SparseBool const*>(this)->toString(); }
+        bool toString(std::wostringstream& ostr) const;
+        bool toString(std::wostringstream& ostr)
+        { return const_cast<SparseBool const*>(this)->toString(ostr); }
 
         /* Config management and GenericType methods overrides */
         SparseBool* clone(void) const;
index 489ab42..2727849 100644 (file)
@@ -51,7 +51,7 @@ namespace types
         bool                    operator==(const InternalType& it);
         bool                    operator!=(const InternalType& it);
 
-        void                    subMatrixToString(std::wostringstream& ostr, int* _piDims, int _iDims);
+        bool                    subMatrixToString(std::wostringstream& ostr, int* _piDims, int _iDims);
         /* return type as string ( double, int, cell, list, ... )*/
         virtual std::wstring    getTypeStr() {return L"string";}
         /* return type as short string ( s, i, ce, l, ... )*/
index 00595b7..7a4ff3c 100644 (file)
@@ -59,11 +59,11 @@ namespace types
         /* return type as short string ( s, i, ce, l, ... )*/
         virtual std::wstring        getShortTypeStr() {return L"st";};
         virtual bool                isContainer(void) { return true; }
-        void                        subMatrixToString(std::wostringstream& ostr, int* _piDims, int _iDims);
+        bool                        subMatrixToString(std::wostringstream& ostr, int* _piDims, int _iDims);
         String*                     getFieldNames();
         bool                        exists(const std::wstring& _sKey);
         bool                        addField(const std::wstring& _sKey);
-        virtual std::wstring        toString();
+        bool                        toString(std::wostringstream& ostr);
         std::vector<InternalType*>  extractFields(std::list<std::wstring> _wstFields);
 
 
index 4150620..2e36e7e 100644 (file)
@@ -30,7 +30,7 @@ namespace types
         virtual                 ~ThreadId();
 
         bool                    isThreadId() { return true; }
-        std::wstring            toString();
+        bool                    toString(std::wostringstream& ostr);
 
         /* return type as string ( double, int, cell, list, ... )*/
         virtual std::wstring    getTypeStr() {return L"ThreadId";}
index b99ef52..0a5fc0a 100644 (file)
@@ -15,6 +15,7 @@
 
 #include <sstream>
 #include "dynlib_types.h"
+#include "os_swprintf.h"
 
 #define SIZE_BETWEEN_TWO_VALUES         2
 #define SPACE_BETWEEN_TWO_VALUES        L"  "
@@ -30,6 +31,8 @@
 #define MINUS_STRING_INT                L" -"
 #define SYMBOL_I                        L"i"
 
+
+#define MAX_LINES                       100
 #ifndef _MSC_VER
 #include <inttypes.h>
 #define _abs64(x) llabs(x)
@@ -71,51 +74,59 @@ template <typename T>
 void getUnsignedIntFormat(T _TVal, int *_piWidth)
 {
     *_piWidth = static_cast<int>(log10(static_cast<long double>(_TVal)) + 1);
+    *_piWidth += 1;
 }
 
 template <typename T>
 void getSignedIntFormat(T _TVal, int *_piWidth)
 {
     *_piWidth = static_cast<int>(log10(static_cast<long double>(_abs64(_TVal))) + 1);
+    *_piWidth += 1;
 }
 
 template <typename T>
 void addUnsignedIntValue(std::wostringstream *_postr, T _TVal, int _iWidth, bool bPrintPlusSign = false, bool bPrintOne = true)
 {
+    wchar_t* pwstSign = NULL;
+    wchar_t pwstFormat[32];
+    wchar_t pwstOutput[32];
        if(bPrintPlusSign == true)
        {
-               *_postr << PLUS_STRING;
+               pwstSign = PLUS_STRING;
        }
        else
        {
-               *_postr << NO_SIGN;
+               pwstSign = NO_SIGN;
        }
 
-       configureStream(_postr, _iWidth, 0, ' ');
-
        if(bPrintOne == true || _TVal != 1)
        {
-        *_postr << std::right << static_cast<unsigned long long>(_TVal);
+        os_swprintf(pwstFormat, 32, L" %ls%ld", pwstSign, _abs64(_TVal));
+        os_swprintf(pwstOutput, 32, L"%*ls", _iWidth + 1, pwstFormat);//+1 for blank
+        *_postr << pwstOutput;
        }
 }
 
 template <typename T>
 void addSignedIntValue(std::wostringstream *_postr, T _TVal, int _iWidth, bool bPrintPlusSign = false, bool bPrintOne = true)
 {
+    const wchar_t* pwstSign = NULL;
+    wchar_t pwstFormat[32];
+    wchar_t pwstOutput[32];
        if(bPrintPlusSign == true)
        {
-               *_postr << (_TVal < 0 ? MINUS_STRING_INT : PLUS_STRING);
+               pwstSign = (_TVal < 0 ? L"-" : L"+");
        }
        else
        {
-               *_postr << (_TVal < 0 ? MINUS_STRING_INT : NO_SIGN);
+               pwstSign = (_TVal < 0 ? L"-" : L" ");
        }
 
-       configureStream(_postr, _iWidth, 0, ' ');
-
        if(bPrintOne == true || _TVal != 1)
        {
-        *_postr << std::right << static_cast<long long>(_abs64(_TVal));
+        os_swprintf(pwstFormat, 32, L" %ls%ld", pwstSign, _abs64(_TVal));
+        os_swprintf(pwstOutput, 32, L"%*ls", _iWidth + 1, pwstFormat);//+1 for blank
+        *_postr << pwstOutput;
        }
 }
 
index 5881932..d47eeee 100644 (file)
@@ -57,7 +57,7 @@ namespace types
         RealType                                   getType(void){return InternalType::RealUInt16;}
 
     private :
-        virtual void                subMatrixToString(std::wostringstream& ostr, int* _piDims, int _iDims);
+        virtual bool                subMatrixToString(std::wostringstream& ostr, int* _piDims, int _iDims);
 
         virtual unsigned short      getNullValue();
         virtual UInt16*             createEmpty(int _iDims, int* _piDims, bool _bComplex = false);
index a7cfc43..edd2075 100644 (file)
@@ -57,7 +57,7 @@ namespace types
         RealType                                   getType(void){return InternalType::RealUInt32;}
 
     private :
-        virtual void                subMatrixToString(std::wostringstream& ostr, int* _piDims, int _iDims);
+        virtual bool                subMatrixToString(std::wostringstream& ostr, int* _piDims, int _iDims);
 
         virtual unsigned int        getNullValue();
         virtual UInt32*             createEmpty(int _iDims, int* _piDims, bool _bComplex = false);
index 95eebf2..5c08add 100644 (file)
@@ -57,7 +57,7 @@ namespace types
         RealType                                   getType(void){return InternalType::RealUInt64;}
 
     private :
-        virtual void                subMatrixToString(std::wostringstream& ostr, int* _piDims, int _iDims);
+        virtual bool                subMatrixToString(std::wostringstream& ostr, int* _piDims, int _iDims);
 
         virtual unsigned long long  getNullValue();
         virtual UInt64*             createEmpty(int _iDims, int* _piDims, bool _bComplex = false);
index b93d6e1..eb56c38 100644 (file)
@@ -57,7 +57,7 @@ namespace types
         RealType                                   getType(void){return InternalType::RealUInt8;}
 
     private :
-        virtual void                subMatrixToString(std::wostringstream& ostr, int* _piDims, int _iDims);
+        virtual bool                subMatrixToString(std::wostringstream& ostr, int* _piDims, int _iDims);
 
         virtual unsigned char       getNullValue();
         virtual UInt8*              createEmpty(int _iDims, int* _piDims, bool _bComplex = false);
index 86a880a..afa066c 100644 (file)
@@ -31,7 +31,7 @@ namespace types
         ** in order Scilab engine to manage correctly this user type
         */
     public :
-        virtual std::wstring     toString() = 0;
+        virtual bool            toString(std::wostringstream& ostr) = 0;
         virtual std::wstring     getTypeStr() = 0;
         virtual std::wstring     getShortTypeStr() = 0;
         virtual InternalType*    clone() = 0;
index 7cebbf3..45a2da3 100644 (file)
@@ -46,9 +46,10 @@ public :
     std::wstring getShortTypeStr()       { return m_shortName; }
 
     /* This is Scilab standard display or in disp. */
-    std::wstring toString()
+    bool toString(std::wostringstream& ostr)
     {
-        return L"I'm a user dataType: " + m_longName + L" (" + m_shortName + L").";
+        ostr << L"I'm a user dataType: " + m_longName + L" (" + m_shortName + L").";
+        return true;
     }
 
 private :
index 1706fb2..b7b6465 100644 (file)
@@ -107,23 +107,31 @@ namespace types
         return true;
     }
 
-    void Bool::subMatrixToString(std::wostringstream& ostr, int* _piDims, int _iDims)
+    bool Bool::subMatrixToString(std::wostringstream& ostr, int* _piDims, int _iDims)
     {
+        int iCurrentLine = 0;
         int iLineLen = getConsoleWidth();
+        int iMaxLines = getConsoleLines();
 
-        /*Comment tenir compte de la longueur des lignes dans le formatage de variable ? */
         if(isScalar())
         {//scalar
             _piDims[0] = 0;
             _piDims[1] = 0;
             int iPos = getIndex(_piDims);
-            ostr << L"  ";
-            ostr << (get(iPos) == 1 ? L"T" : L"F");
+            ostr << (get(iPos) == 1 ? L"  T" : L"  F");
+            ostr << std::endl;
         }
         else if(getCols() == 1)
         {//column vector
-            for(int i = 0 ; i < getRows() ; i++)
+            for(int i = m_iRows1PrintState ; i < getRows() ; i++)
             {
+                iCurrentLine++;
+                if((iMaxLines == 0 && iCurrentLine >= MAX_LINES) || (iMaxLines != 0 && iCurrentLine >= iMaxLines))
+                {
+                    m_iRows1PrintState = i;
+                    return false;
+                }
+
                 _piDims[1] = 0;
                 _piDims[0] = i;
                 int iPos = getIndex(_piDims);
@@ -133,99 +141,130 @@ namespace types
         }
         else if(getRows() == 1)
         {//row vector
-            bool bWordWarp = false;
-            int iLineTag = 5000; //or not Oo
-            std::wstring szTemp;
-
-            if(iLineLen == -1)
-            {
-                bWordWarp = true;
-            }
+            std::wostringstream ostemp;
+            int iLastVal = m_iCols1PrintState;
+            int iLen = 0;
 
-            for(int i = 0 ; i < getCols() ; i++)
+            for(int i = m_iCols1PrintState ; i < getCols() ; i++)
             {
-
                 _piDims[0] = 0;
                 _piDims[1] = i;
                 int iPos = getIndex(_piDims);
-                if(bWordWarp == false && static_cast<int>(szTemp.size() + 1) >= iLineLen)
-                {
-                    bWordWarp = true;
-                    iLineTag   = i;
-                }
 
-                szTemp += L"  ";
-                if(bWordWarp == true && i%iLineTag == 0)
+                if(iLen + 2 >= iLineLen)
                 {
-                    ostr << std::endl << L"         column " << (i - 1) / (iLineTag + 1) * iLineTag + 1 << L" to " << i << std::endl << std::endl;
-                    ostr << szTemp << std::endl;
-                    szTemp     = L"  ";
+                    iCurrentLine += 4; //"column x to Y" + empty line + value + empty line
+                    if((iMaxLines == 0 && iCurrentLine >= MAX_LINES) || (iMaxLines != 0 && iCurrentLine >= iMaxLines))
+                    {
+                        m_iCols1PrintState = iLastVal;
+                        return false;
+                    }
+
+                    ostr << std::endl << L"       column " << iLastVal + 1 << L" to " << i << std::endl << std::endl;
+                    ostr << L" " << ostemp.str() << std::endl;
+                    ostemp.str(L"");
+                    iLastVal = i;
+                    iLen = 0;
                 }
 
-                szTemp += (get(iPos) ? L"T" : L"F");
+                ostemp << (get(iPos) ? L" T" : L" F");
+                iLen += 2;
             }
 
-            if(bWordWarp == true)
+            if(iLastVal != 0)
             {
-                ostr << std::endl << L"         column " << (getCols() - 1) / (iLineTag + 1) * iLineTag + 1 << L" to " << getCols() << std::endl << std::endl;
+                ostr << std::endl << L"       column " << iLastVal + 1 << L" to " << getCols() << std::endl << std::endl;
             }
-            ostr << szTemp;
+            ostr << L" " << ostemp.str() << std::endl;
         }
         else
         {
             std::wostringstream ostemp;
             int iLen = 0;
-            int iLastCol = 0;
+            int iLastCol = m_iCols1PrintState;
 
             //compute the row size for padding for each printed bloc.
-            for(int iCols1 = 0 ; iCols1 < getCols() ; iCols1++)
+            for(int iCols1 = m_iCols1PrintState ; iCols1 < getCols() ; iCols1++)
             {
-                if(iLen + SIZE_BOOL > iLineLen)
+                if(iLen + 2 > iLineLen)
                 {//find the limit, print this part
-                    for(int iRows2 = 0 ; iRows2 < getRows() ; iRows2++)
+                    for(int iRows2 = m_iRows2PrintState ; iRows2 < getRows() ; iRows2++)
                     {
-                        ostemp << L"  ";
+                        iCurrentLine++;
+                        if((iMaxLines == 0 && iCurrentLine >= MAX_LINES) ||
+                            ( (iMaxLines != 0 && iCurrentLine + 3 >= iMaxLines && iRows2 == m_iRows2PrintState) || 
+                            (iMaxLines != 0 && iCurrentLine + 1 >= iMaxLines && iRows2 != m_iRows2PrintState)))
+                        {
+                            if(m_iRows2PrintState == 0 && iRows2 != 0)
+                            {//add header
+                                ostr << std::endl << L"       column " << iLastCol + 1 << L" to " << iCols1 << std::endl << std::endl;
+                            }
+                            ostr << L" " << ostemp.str();
+                            m_iRows2PrintState = iRows2;
+                            m_iCols1PrintState = iLastCol;
+                            return false;
+                        }
+
                         for(int iCols2 = iLastCol ; iCols2 < iCols1 ; iCols2++)
                         {
                             _piDims[0] = iRows2;
                             _piDims[1] = iCols2;
-
                             int iPos = getIndex(_piDims);
-                            ostemp << (get(iPos) == 0 ? L"F" : L"T");
-                            ostemp << SPACE_BETWEEN_BOOL;
+                            ostemp << (get(iPos) == 0 ? L" F" : L" T");
                         }
-                        ostemp << std::endl;
+                        ostemp << std::endl << L" ";
                     }
                     iLen = 0;
-                    ostr << std::endl << L"       column " << iLastCol + 1 << L" to " << iCols1 << std::endl << std::endl;;
-                    ostr << ostemp.str();
+                    iCurrentLine++;
+                    if(m_iRows2PrintState == 0)
+                    {
+                        iCurrentLine += 3;
+                        ostr << std::endl << L"       column " << iLastCol + 1 << L" to " << iCols1 << std::endl << std::endl;
+                    }
+
+                    ostr << L" " << ostemp.str();
                     ostemp.str(L"");
                     iLastCol = iCols1;
-
+                    m_iRows2PrintState = 0;
+                    m_iCols1PrintState = 0;
                 }
-                iLen += SIZE_BOOL + SIZE_BETWEEN_BOOL;
+                iLen += 2;
             }
 
-            for(int iRows2 = 0 ; iRows2 < getRows() ; iRows2++)
+            for(int iRows2 = m_iRows2PrintState ; iRows2 < getRows() ; iRows2++)
             {
-                ostemp << L"  ";
+                iCurrentLine++;
+                if((iMaxLines == 0 && iCurrentLine >= MAX_LINES) || (iMaxLines != 0 && iCurrentLine >= iMaxLines))
+                {
+                    if(m_iRows2PrintState == 0 && iLastCol != 0)
+                    {//add header
+                        ostr << std::endl << L"       column " << iLastCol + 1 << L" to " << getCols() << std::endl << std::endl;
+                    }
+
+                    ostr << ostemp.str();
+                    m_iRows2PrintState = iRows2;
+                    m_iCols1PrintState = iLastCol;
+                    return false;
+                }
+
                 for(int iCols2 = iLastCol ; iCols2 < getCols() ; iCols2++)
                 {
                     _piDims[0] = iRows2;
                     _piDims[1] = iCols2;
-
                     int iPos = getIndex(_piDims);
-                    ostemp << (get(iPos) == 0 ? L"F" : L"T");
-                    ostemp << SPACE_BETWEEN_BOOL;
+
+                    ostemp << (get(iPos) == 0 ? L" F" : L" T");
                 }
-                ostemp << std::endl;
+                ostemp << std::endl << L" ";
             }
-            if(iLastCol != 0)
+            if(m_iRows2PrintState == 0 && iLastCol != 0)
             {
                 ostr << std::endl << L"       column " << iLastCol + 1 << L" to " << getCols() << std::endl << std::endl;
             }
             ostr << ostemp.str();
         }
+
+        return true;
     }
 
     bool Bool::operator==(const InternalType& it)
index 95129d6..4401d4b 100644 (file)
@@ -226,7 +226,7 @@ namespace types
     ** toString to display Structs
     ** FIXME : Find a better indentation process
     */
-    void Cell::subMatrixToString(std::wostringstream& ostr, int* _piDims, int _iDims)
+    bool Cell::subMatrixToString(std::wostringstream& ostr, int* _piDims, int _iDims)
     {
         int iPrecision = getFormatSize();
 
@@ -338,6 +338,7 @@ namespace types
             delete[] piTypeLen;
         }
         ostr << std::endl;
+        return true;
     }
 
     //bool Cell::append(int _iRows, int _iCols, Cell *_poSource)
index 081442e..9c1058e 100644 (file)
@@ -230,9 +230,11 @@ namespace types
                return true;
        }
 
-    void Double::subMatrixToString(wostringstream& ostr, int* _piDims, int _iDims)
+    bool Double::subMatrixToString(wostringstream& ostr, int* _piDims, int _iDims)
     {
+        int iCurrentLine = 0;
         int iLineLen = getConsoleWidth();
+        int iMaxLines = getConsoleLines();
 
         if(isIdentity())
         {
@@ -288,8 +290,15 @@ namespace types
 
             if(isComplex() == false)
             {
-                for(int i = 0 ; i < getRows() ; i++)
+                for(int i = m_iRows1PrintState ; i < getRows() ; i++)
                 {
+                    iCurrentLine++;
+                    if((iMaxLines == 0 && iCurrentLine >= MAX_LINES) || (iMaxLines != 0 && iCurrentLine >= iMaxLines))
+                    {
+                        m_iRows1PrintState = i;
+                        return false;
+                    }
+
                     _piDims[1] = 0;
                     _piDims[0] = i;
                     int iPos = getIndex(_piDims);
@@ -303,8 +312,15 @@ namespace types
             }
             else
             {
-                for(int i = 0 ; i < getRows() ; i++)
+                for(int i = m_iRows1PrintState ; i < getRows() ; i++)
                 {//complex value
+                    iCurrentLine++;
+                    if((iMaxLines == 0 && iCurrentLine >= MAX_LINES) || (iMaxLines != 0 && iCurrentLine >= iMaxLines))
+                    {
+                        m_iRows1PrintState = i;
+                        return false;
+                    }
+
                     _piDims[1] = 0;
                     _piDims[0] = i;
                     int iPos = getIndex(_piDims);
@@ -322,11 +338,11 @@ namespace types
         else if(getRows() == 1)
         {//row vector
             wostringstream ostemp;
-            int iLastVal = 0;
+            int iLastVal = m_iCols1PrintState;
 
             if(isComplex() == false)
             {
-                for(int i = 0 ; i < getCols() ; i++)
+                for(int i = m_iCols1PrintState ; i < getCols() ; i++)
                 {
                     int iLen = 0;
                     _piDims[0] = 0;
@@ -338,6 +354,14 @@ namespace types
                     iLen = df.iWidth + static_cast<int>(ostemp.str().size());
                     if(iLen > iLineLen)
                     {//Max length, new line
+                        iCurrentLine += 4; //"column x to Y" + empty line + value + empty line
+                        if((iMaxLines == 0 && iCurrentLine >= MAX_LINES) || (iMaxLines != 0 && iCurrentLine >= iMaxLines))
+                        {
+                            m_iCols1PrintState = iLastVal;
+                            ostr << endl << endl;
+                            return false;
+                        }
+
                         ostr << endl << L"       column " << iLastVal + 1 << L" to " << i << endl << endl;
                         ostr << ostemp.str() << endl;
                         ostemp.str(L"");
@@ -352,10 +376,12 @@ namespace types
                 {
                     ostr << endl << L"       column " << iLastVal + 1 << L" to " << getCols() << endl << endl;
                 }
+                ostemp << endl;
+                ostr << ostemp.str();
             }
             else //complex case
             {
-                for(int i = 0 ; i < getCols() ; i++)
+                for(int i = m_iCols1PrintState ; i < getCols() ; i++)
                 {
                     int iLen = 0;
                     _piDims[0] = 0;
@@ -396,6 +422,14 @@ namespace types
 
                     if(iLen > iLineLen)
                     {//Max length, new line
+                        iCurrentLine += 4; //"column x to Y" + empty line + value + empty line
+                        if((iMaxLines == 0 && iCurrentLine >= MAX_LINES) || (iMaxLines != 0 && iCurrentLine >= iMaxLines))
+                        {
+                            m_iCols1PrintState = iLastVal;
+                            ostr << endl << endl;
+                            return false;
+                        }
+
                         ostr << endl << L"       column " << iLastVal + 1 << L" to " << i << endl << endl;
                         ostr << ostemp.str() << endl;
                         ostemp.str(L"");
@@ -410,15 +444,15 @@ namespace types
                 {
                     ostr << endl << L"       column " << iLastVal + 1 << L" to " << getCols() << endl << endl;
                 }
+                ostemp << endl;
+                ostr << ostemp.str();
             }
-            ostemp << endl;
-            ostr << ostemp.str();
         }
         else // matrix
         {
             wostringstream ostemp;
             int iLen = 0;
-            int iLastCol = 0;
+            int iLastCol = m_iCols1PrintState;
 
             //Array with the max printed size of each col
             int *piSize = new int[getCols()];
@@ -427,7 +461,7 @@ namespace types
             if(isComplex() == false)
             {
                 //compute the row size for padding for each printed bloc.
-                for(int iCols1 = 0 ; iCols1 < getCols() ; iCols1++)
+                for(int iCols1 = m_iCols1PrintState ; iCols1 < getCols() ; iCols1++)
                 {
                     for(int iRows1 = 0 ; iRows1 < getRows() ; iRows1++)
                     {
@@ -448,8 +482,23 @@ namespace types
 
                     if(iLen + piSize[iCols1] > iLineLen)
                     {//find the limit, print this part
-                        for(int iRows2 = 0 ; iRows2 < getRows() ; iRows2++)
+                        for(int iRows2 = m_iRows2PrintState ; iRows2 < getRows() ; iRows2++)
                         {
+                            iCurrentLine++;
+                            if((iMaxLines == 0 && iCurrentLine >= MAX_LINES) ||
+                                ( (iMaxLines != 0 && iCurrentLine + 3 >= iMaxLines && iRows2 == m_iRows2PrintState) || 
+                                (iMaxLines != 0 && iCurrentLine + 1 >= iMaxLines && iRows2 != m_iRows2PrintState)))
+                            {
+                                if(m_iRows2PrintState == 0 && iRows2 != 0)
+                                {//add header
+                                    ostr << std::endl << L"       column " << iLastCol + 1 << L" to " << iCols1 << std::endl << std::endl;
+                                }
+                                ostr << ostemp.str();
+                                m_iRows2PrintState = iRows2;
+                                m_iCols1PrintState = iLastCol;
+                                return false;
+                            }
+
                             for(int iCols2 = iLastCol ; iCols2 < iCols1 ; iCols2++)
                             {
                                 _piDims[0] = iRows2;
@@ -466,18 +515,41 @@ namespace types
                             }
                             ostemp << endl;
                         }
+
                         iLen = 0;
-                        ostr << endl << L"       column " << iLastCol + 1 << L" to " << iCols1 << endl << endl;;
+
+                        iCurrentLine++;
+                        if(m_iRows2PrintState == 0)
+                        {
+                            iCurrentLine += 3;
+                            ostr << std::endl << L"       column " << iLastCol + 1 << L" to " << iCols1 << std::endl << std::endl;
+                        }
                         ostr << ostemp.str();
                         ostemp.str(L"");
                         iLastCol = iCols1;
-
+                        m_iRows2PrintState = 0;
+                        m_iCols1PrintState = 0;
                     }
+
                     iLen += piSize[iCols1] + SIGN_LENGTH + SIZE_BETWEEN_TWO_VALUES;
                 }
 
-                for(int iRows2 = 0 ; iRows2 < getRows() ; iRows2++)
+                for(int iRows2 = m_iRows2PrintState ; iRows2 < getRows() ; iRows2++)
                 {
+                    iCurrentLine++;
+                    if((iMaxLines == 0 && iCurrentLine >= MAX_LINES) || (iMaxLines != 0 && iCurrentLine >= iMaxLines))
+                    {
+                        if(m_iRows2PrintState == 0 && iLastCol != 0)
+                        {//add header
+                            ostr << std::endl << L"       column " << iLastCol + 1 << L" to " << getCols() << std::endl << std::endl;
+                        }
+
+                        ostr << ostemp.str();
+                        m_iRows2PrintState = iRows2;
+                        m_iCols1PrintState = iLastCol;
+                        return false;
+                    }
+
                     for(int iCols2 = iLastCol ; iCols2 < getCols() ; iCols2++)
                     {
                         _piDims[0] = iRows2;
@@ -493,16 +565,17 @@ namespace types
                     }
                     ostemp << endl;
                 }
-                if(iLastCol != 0)
+
+                if(m_iRows2PrintState == 0 && iLastCol != 0)
                 {
-                    ostr << endl << L"       column " << iLastCol + 1 << L" to " << getCols() << endl << endl;
+                    ostr << std::endl << L"       column " << iLastCol + 1 << L" to " << getCols() << std::endl << std::endl;
                 }
                 ostr << ostemp.str();
             }
             else //Complex case
             {
                 //compute the row size for padding for each printed bloc.
-                for(int iCols1 = 0 ; iCols1 < getCols() ; iCols1++)
+                for(int iCols1 = m_iCols1PrintState ; iCols1 < getCols() ; iCols1++)
                 {
                     for(int iRows1 = 0 ; iRows1 < getRows() ; iRows1++)
                     {
@@ -523,8 +596,23 @@ namespace types
 
                     if(iLen + piSize[iCols1] > iLineLen)
                     {//find the limit, print this part
-                        for(int iRows2 = 0 ; iRows2 < getRows() ; iRows2++)
+                        for(int iRows2 = m_iRows2PrintState ; iRows2 < getRows() ; iRows2++)
                         {
+                            iCurrentLine++;
+                            if((iMaxLines == 0 && iCurrentLine >= MAX_LINES) ||
+                                ( (iMaxLines != 0 && iCurrentLine + 3 >= iMaxLines && iRows2 == m_iRows2PrintState) || 
+                                (iMaxLines != 0 && iCurrentLine + 1 >= iMaxLines && iRows2 != m_iRows2PrintState)))
+                            {
+                                if(m_iRows2PrintState == 0 && iRows2 != 0)
+                                {//add header
+                                    ostr << std::endl << L"       column " << iLastCol + 1 << L" to " << iCols1 << std::endl << std::endl;
+                                }
+                                ostr << ostemp.str();
+                                m_iRows2PrintState = iRows2;
+                                m_iCols1PrintState = iLastCol;
+                                return false;
+                            }
+
                             for(int iCols2 = iLastCol ; iCols2 < iCols1 ; iCols2++)
                             {
                                 int iTotalWidth = 0;
@@ -540,18 +628,41 @@ namespace types
                             }
                             ostemp << endl;
                         }
+                  
                         iLen = 0;
-                        ostr << endl << L"       column " << iLastCol + 1 << L" to " << iCols1 << endl << endl;;
+
+                        iCurrentLine++;
+                        if(m_iRows2PrintState == 0)
+                        {
+                            iCurrentLine += 3;
+                            ostr << std::endl << L"       column " << iLastCol + 1 << L" to " << iCols1 << std::endl << std::endl;
+                        }
                         ostr << ostemp.str();
                         ostemp.str(L"");
                         iLastCol = iCols1;
-
+                        m_iRows2PrintState = 0;
+                        m_iCols1PrintState = 0;
                     }
+
                     iLen += piSize[iCols1] + SIZE_BETWEEN_TWO_VALUES;
                 }
 
-                for(int iRows2 = 0 ; iRows2 < getRows() ; iRows2++)
+                for(int iRows2 = m_iRows2PrintState ; iRows2 < getRows() ; iRows2++)
                 {
+                    iCurrentLine++;
+                    if((iMaxLines == 0 && iCurrentLine >= MAX_LINES) || (iMaxLines != 0 && iCurrentLine >= iMaxLines))
+                    {
+                        if(m_iRows2PrintState == 0 && iLastCol != 0)
+                        {//add header
+                            ostr << std::endl << L"       column " << iLastCol + 1 << L" to " << getCols() << std::endl << std::endl;
+                        }
+
+                        ostr << ostemp.str();
+                        m_iRows2PrintState = iRows2;
+                        m_iCols1PrintState = iLastCol;
+                        return false;
+                    }
+
                     for(int iCols2 = iLastCol ; iCols2 < getCols() ; iCols2++)
                     {
                         int iTotalWidth = 0;
@@ -568,13 +679,15 @@ namespace types
                     ostemp << endl;
                 }
 
-                if(iLastCol != 0)
+                if(m_iRows2PrintState == 0 && iLastCol != 0)
                 {
                     ostr << endl << L"       column " << iLastCol + 1 << L" to " << getCols() << endl << endl;
                 }
                 ostr << ostemp.str();
             }
         }
+
+        return true;
     }
 
        InternalType* Double::clone()
index b2f4438..89cf79d 100644 (file)
@@ -354,13 +354,12 @@ namespace types
                return true;
        }
 
-    std::wstring Float::toString()
+    bool Float::toString(std::wostringstream& ostr)
        {
-        std::wostringstream ostr;
                // FIXME : Implement display method.
                ostr << L"Float Values" << std::endl;
 
-               return ostr.str();
+               return true;
        }
 
 }
index d6e9e1e..e241db1 100644 (file)
@@ -95,14 +95,12 @@ namespace types
         std::cout << "types::Function";
     }
 
-    std::wstring Function::toString()
+    bool Function::toString(std::wostringstream& ostr)
     {
-        std::wostringstream ostr;
-
         // FIXME : Implement me.
         ostr << L"FIXME : Implement Function::toString" << std::endl;
 
-        return ostr.str();
+        return true;
     }
 
     InternalType* Function::clone()
index 4c51a4c..19158a6 100644 (file)
@@ -60,9 +60,10 @@ namespace types
         return true;
     }
 
-    std::wstring SingleHandle::toString()
+    bool SingleHandle::toString(std::wostringstream& ostr)
     {
-        return L"SingleHandle::toString";
+        ostr << L"SingleHandle::toString";
+        return true;
     }
 
     char* SingleHandle::getHandleID()
@@ -198,8 +199,9 @@ namespace types
         return !(*this == it);
     }
 
-    void GraphicHandle::subMatrixToString(std::wostringstream& ostr, int* _piDims, int _iDims)
+    bool GraphicHandle::subMatrixToString(std::wostringstream& ostr, int* _piDims, int _iDims)
     {
+        return true;
     }
 
     SingleHandle* GraphicHandle::getNullValue()
index 400b5d1..f131a95 100644 (file)
@@ -354,15 +354,14 @@ namespace types
         return true;
     }
 
-    std::wstring ImplicitList::toString()
+    bool ImplicitList::toString(std::wostringstream& ostr)
     {
         if(isComputable())
         {
-            return extractFullMatrix()->toString();
+            return extractFullMatrix()->toString(ostr);
         }
         else
         {
-            std::wostringstream ostr;
             ostr << L" ";
             if(m_eStartType == RealDouble)
             {
@@ -401,7 +400,7 @@ namespace types
                 ostr << printInLinePoly(pMP->get(0), pMP->getVariableName());
             }
             ostr << std::endl;
-            return ostr.str();
+            return true;
         }
     }
 
index 675fd96..2db0b69 100644 (file)
@@ -84,12 +84,12 @@ namespace types
         std::cout << "types::Int16";
     }
 
-    void Int16::subMatrixToString(std::wostringstream& ostr, int* _piDims, int _iDims)
+    bool Int16::subMatrixToString(std::wostringstream& ostr, int* _piDims, int _iDims)
     {
+        int iCurrentLine = 0;
         int iLineLen = getConsoleWidth();
+        int iMaxLines = getConsoleLines();
 
-        ostr << std::endl;
-        /*Comment tenir compte de la longueur des lignes dans le formatage de variable ? */
         if(isScalar())
         {//scalar
             int iWidth  = 0;
@@ -103,25 +103,42 @@ namespace types
         }
         else if(getCols() == 1)
         {//column vector
+            int iWidthMax = 0;
 
+            //Array with the max printed size of each col
             for(int i = 0 ; i < getRows() ; i++)
             {
-                int iWidth  = 0;
+                _piDims[1] = 0;
+                _piDims[0] = i;
+                int iWidth = 0;
+                int iPos = getIndex(_piDims);
+                getSignedIntFormat(get(iPos), &iWidth);
+                iWidthMax = Max(iWidthMax, iWidth);
+            }
+
+            for(int i = m_iRows1PrintState ; i < getRows() ; i++)
+            {
+                iCurrentLine++;
+                if((iMaxLines == 0 && iCurrentLine >= MAX_LINES) || (iMaxLines != 0 && iCurrentLine >= iMaxLines))
+                {
+                    m_iRows1PrintState = i;
+                    return false;
+                }
+
                 _piDims[1]  = 0;
                 _piDims[0]  = i;
                 int iPos    = getIndex(_piDims);
 
-                getSignedIntFormat(get(iPos), &iWidth);
-                addSignedIntValue(&ostr, get(iPos), iWidth);
+                addSignedIntValue(&ostr, get(iPos), iWidthMax);
                 ostr << std::endl;
             }
         }
         else if(getRows() == 1)
         {//row vector
             std::wostringstream ostemp;
-            int iLastVal = 0;
+            int iLastVal = m_iCols1PrintState;
 
-            for(int i = 0 ; i < getCols() ; i++)
+            for(int i = m_iCols1PrintState ; i < getCols() ; i++)
             {
                 int iWidth  = 0;
                 int iLen    = 0;
@@ -133,17 +150,19 @@ namespace types
                 iLen = iWidth + static_cast<int>(ostemp.str().size());
                 if(iLen > iLineLen)
                 {//Max length, new line
+                    iCurrentLine += 4; //"column x to Y" + empty line + value + empty line
+                    if((iMaxLines == 0 && iCurrentLine >= MAX_LINES) || (iMaxLines != 0 && iCurrentLine >= iMaxLines))
+                    {
+                        m_iCols1PrintState = iLastVal;
+                        return false;
+                    }
+
                     ostr << std::endl << L"       column " << iLastVal + 1 << L" to " << i << std::endl << std::endl;
                     ostr << ostemp.str() << std::endl;
                     ostemp.str(L"");
                     iLastVal = i;
                 }
 
-                if(ostemp.str().size() != 0)
-                {
-                    ostemp << SPACE_BETWEEN_TWO_VALUES;
-                }
-
                 addSignedIntValue(&ostemp, get(iPos), iWidth);
             }
 
@@ -158,14 +177,14 @@ namespace types
         {
             std::wostringstream ostemp;
             int iLen = 0;
-            int iLastCol = 0;
+            int iLastCol = m_iCols1PrintState;
 
             //Array with the max printed size of each col
             int *piSize = new int[getCols()];
             memset(piSize, 0x00, getCols() * sizeof(int));
 
             //compute the row size for padding for each printed bloc.
-            for(int iCols1 = 0 ; iCols1 < getCols() ; iCols1++)
+            for(int iCols1 = m_iCols1PrintState ; iCols1 < getCols() ; iCols1++)
             {
                 for(int iRows1 = 0 ; iRows1 < getRows() ; iRows1++)
                 {
@@ -180,8 +199,23 @@ namespace types
 
                 if(iLen + piSize[iCols1] > iLineLen)
                 {//find the limit, print this part
-                    for(int iRows2 = 0 ; iRows2 < getRows() ; iRows2++)
+                    for(int iRows2 = m_iRows2PrintState ; iRows2 < getRows() ; iRows2++)
                     {
+                        iCurrentLine++;
+                        if((iMaxLines == 0 && iCurrentLine >= MAX_LINES) ||
+                            ( (iMaxLines != 0 && iCurrentLine + 3 >= iMaxLines && iRows2 == m_iRows2PrintState) || 
+                            (iMaxLines != 0 && iCurrentLine + 1 >= iMaxLines && iRows2 != m_iRows2PrintState)))
+                        {
+                            if(m_iRows2PrintState == 0 && iRows2 != 0)
+                            {//add header
+                                ostr << std::endl << L"       column " << iLastCol + 1 << L" to " << iCols1 << std::endl << std::endl;
+                            }
+                            ostr << ostemp.str();
+                            m_iRows2PrintState = iRows2;
+                            m_iCols1PrintState = iLastCol;
+                            return false;
+                        }
+
                         for(int iCols2 = iLastCol ; iCols2 < iCols1 ; iCols2++)
                         {
                             int iWidth  = 0;
@@ -190,22 +224,44 @@ namespace types
                             int iPos    = getIndex(_piDims);
 
                             addSignedIntValue(&ostemp, get(iPos), piSize[iCols2]);
-                            ostemp << SPACE_BETWEEN_TWO_VALUES;
                         }
                         ostemp << std::endl;
                     }
                     iLen = 0;
-                    ostr << std::endl << L"       column " << iLastCol + 1 << L" to " << iCols1 << std::endl << std::endl;;
+
+                    iCurrentLine++;
+                    if(m_iRows2PrintState == 0)
+                    {
+                        iCurrentLine += 3;
+                        ostr << std::endl << L"       column " << iLastCol + 1 << L" to " << iCols1 << std::endl << std::endl;
+                    }
+                    
                     ostr << ostemp.str();
                     ostemp.str(L"");
                     iLastCol = iCols1;
-
+                    m_iRows2PrintState = 0;
+                    m_iCols1PrintState = 0;
                 }
+
                 iLen += piSize[iCols1] + SIGN_LENGTH + SIZE_BETWEEN_TWO_VALUES;
             }
 
-            for(int iRows2 = 0 ; iRows2 < getRows() ; iRows2++)
+            for(int iRows2 = m_iRows2PrintState ; iRows2 < getRows() ; iRows2++)
             {
+                iCurrentLine++;
+                if((iMaxLines == 0 && iCurrentLine >= MAX_LINES) || (iMaxLines != 0 && iCurrentLine >= iMaxLines))
+                {
+                    if(m_iRows2PrintState == 0 && iLastCol != 0)
+                    {//add header
+                        ostr << std::endl << L"       column " << iLastCol + 1 << L" to " << getCols() << std::endl << std::endl;
+                    }
+
+                    ostr << ostemp.str();
+                    m_iRows2PrintState = iRows2;
+                    m_iCols1PrintState = iLastCol;
+                    return false;
+                }
+
                 for(int iCols2 = iLastCol ; iCols2 < getCols() ; iCols2++)
                 {
                     int iWidth  = 0;
@@ -214,16 +270,18 @@ namespace types
                     int iPos    = getIndex(_piDims);
 
                     addSignedIntValue(&ostemp, get(iPos), piSize[iCols2]);
-                    ostemp << SPACE_BETWEEN_TWO_VALUES;
                 }
                 ostemp << std::endl;
             }
-            if(iLastCol != 0)
+
+            if(m_iRows2PrintState == 0 && iLastCol != 0)
             {
                 ostr << std::endl << L"       column " << iLastCol + 1 << L" to " << getCols() << std::endl << std::endl;
             }
             ostr << ostemp.str();
         }
+
+        return true;
     }
 
     bool Int16::operator==(const InternalType& it)
index 45958fb..53a108b 100644 (file)
@@ -84,12 +84,12 @@ namespace types
         std::cout << "types::Int32";
     }
 
-    void Int32::subMatrixToString(std::wostringstream& ostr, int* _piDims, int _iDims)
+    bool Int32::subMatrixToString(std::wostringstream& ostr, int* _piDims, int _iDims)
     {
+        int iCurrentLine = 0;
         int iLineLen = getConsoleWidth();
+        int iMaxLines = getConsoleLines();
 
-        ostr << std::endl;
-        /*Comment tenir compte de la longueur des lignes dans le formatage de variable ? */
         if(isScalar())
         {//scalar
             int iWidth  = 0;
@@ -103,25 +103,42 @@ namespace types
         }
         else if(getCols() == 1)
         {//column vector
+            int iWidthMax = 0;
 
+            //Array with the max printed size of each col
             for(int i = 0 ; i < getRows() ; i++)
             {
-                int iWidth  = 0;
+                _piDims[1] = 0;
+                _piDims[0] = i;
+                int iWidth = 0;
+                int iPos = getIndex(_piDims);
+                getSignedIntFormat(get(iPos), &iWidth);
+                iWidthMax = Max(iWidthMax, iWidth);
+            }
+
+            for(int i = m_iRows1PrintState ; i < getRows() ; i++)
+            {
+                iCurrentLine++;
+                if((iMaxLines == 0 && iCurrentLine >= MAX_LINES) || (iMaxLines != 0 && iCurrentLine >= iMaxLines))
+                {
+                    m_iRows1PrintState = i;
+                    return false;
+                }
+
                 _piDims[1]  = 0;
                 _piDims[0]  = i;
                 int iPos    = getIndex(_piDims);
 
-                getSignedIntFormat(get(iPos), &iWidth);
-                addSignedIntValue(&ostr, get(iPos), iWidth);
+                addSignedIntValue(&ostr, get(iPos), iWidthMax);
                 ostr << std::endl;
             }
         }
         else if(getRows() == 1)
         {//row vector
             std::wostringstream ostemp;
-            int iLastVal = 0;
+            int iLastVal = m_iCols1PrintState;
 
-            for(int i = 0 ; i < getCols() ; i++)
+            for(int i = m_iCols1PrintState ; i < getCols() ; i++)
             {
                 int iWidth  = 0;
                 int iLen    = 0;
@@ -133,17 +150,19 @@ namespace types
                 iLen = iWidth + static_cast<int>(ostemp.str().size());
                 if(iLen > iLineLen)
                 {//Max length, new line
+                    iCurrentLine += 4; //"column x to Y" + empty line + value + empty line
+                    if((iMaxLines == 0 && iCurrentLine >= MAX_LINES) || (iMaxLines != 0 && iCurrentLine >= iMaxLines))
+                    {
+                        m_iCols1PrintState = iLastVal;
+                        return false;
+                    }
+
                     ostr << std::endl << L"       column " << iLastVal + 1 << L" to " << i << std::endl << std::endl;
                     ostr << ostemp.str() << std::endl;
                     ostemp.str(L"");
                     iLastVal = i;
                 }
 
-                if(ostemp.str().size() != 0)
-                {
-                    ostemp << SPACE_BETWEEN_TWO_VALUES;
-                }
-
                 addSignedIntValue(&ostemp, get(iPos), iWidth);
             }
 
@@ -158,14 +177,14 @@ namespace types
         {
             std::wostringstream ostemp;
             int iLen = 0;
-            int iLastCol = 0;
+            int iLastCol = m_iCols1PrintState;
 
             //Array with the max printed size of each col
             int *piSize = new int[getCols()];
             memset(piSize, 0x00, getCols() * sizeof(int));
 
             //compute the row size for padding for each printed bloc.
-            for(int iCols1 = 0 ; iCols1 < getCols() ; iCols1++)
+            for(int iCols1 = m_iCols1PrintState ; iCols1 < getCols() ; iCols1++)
             {
                 for(int iRows1 = 0 ; iRows1 < getRows() ; iRows1++)
                 {
@@ -180,8 +199,23 @@ namespace types
 
                 if(iLen + piSize[iCols1] > iLineLen)
                 {//find the limit, print this part
-                    for(int iRows2 = 0 ; iRows2 < getRows() ; iRows2++)
+                    for(int iRows2 = m_iRows2PrintState ; iRows2 < getRows() ; iRows2++)
                     {
+                        iCurrentLine++;
+                        if((iMaxLines == 0 && iCurrentLine >= MAX_LINES) ||
+                            ( (iMaxLines != 0 && iCurrentLine + 3 >= iMaxLines && iRows2 == m_iRows2PrintState) || 
+                            (iMaxLines != 0 && iCurrentLine + 1 >= iMaxLines && iRows2 != m_iRows2PrintState)))
+                        {
+                            if(m_iRows2PrintState == 0 && iRows2 != 0)
+                            {//add header
+                                ostr << std::endl << L"       column " << iLastCol + 1 << L" to " << iCols1 << std::endl << std::endl;
+                            }
+                            ostr << ostemp.str();
+                            m_iRows2PrintState = iRows2;
+                            m_iCols1PrintState = iLastCol;
+                            return false;
+                        }
+
                         for(int iCols2 = iLastCol ; iCols2 < iCols1 ; iCols2++)
                         {
                             int iWidth  = 0;
@@ -190,22 +224,44 @@ namespace types
                             int iPos    = getIndex(_piDims);
 
                             addSignedIntValue(&ostemp, get(iPos), piSize[iCols2]);
-                            ostemp << SPACE_BETWEEN_TWO_VALUES;
                         }
                         ostemp << std::endl;
                     }
                     iLen = 0;
-                    ostr << std::endl << L"       column " << iLastCol + 1 << L" to " << iCols1 << std::endl << std::endl;;
+
+                    iCurrentLine++;
+                    if(m_iRows2PrintState == 0)
+                    {
+                        iCurrentLine += 3;
+                        ostr << std::endl << L"       column " << iLastCol + 1 << L" to " << iCols1 << std::endl << std::endl;
+                    }
+                    
                     ostr << ostemp.str();
                     ostemp.str(L"");
                     iLastCol = iCols1;
-
+                    m_iRows2PrintState = 0;
+                    m_iCols1PrintState = 0;
                 }
+
                 iLen += piSize[iCols1] + SIGN_LENGTH + SIZE_BETWEEN_TWO_VALUES;
             }
 
-            for(int iRows2 = 0 ; iRows2 < getRows() ; iRows2++)
+            for(int iRows2 = m_iRows2PrintState ; iRows2 < getRows() ; iRows2++)
             {
+                iCurrentLine++;
+                if((iMaxLines == 0 && iCurrentLine >= MAX_LINES) || (iMaxLines != 0 && iCurrentLine >= iMaxLines))
+                {
+                    if(m_iRows2PrintState == 0 && iLastCol != 0)
+                    {//add header
+                        ostr << std::endl << L"       column " << iLastCol + 1 << L" to " << getCols() << std::endl << std::endl;
+                    }
+
+                    ostr << ostemp.str();
+                    m_iRows2PrintState = iRows2;
+                    m_iCols1PrintState = iLastCol;
+                    return false;
+                }
+
                 for(int iCols2 = iLastCol ; iCols2 < getCols() ; iCols2++)
                 {
                     int iWidth  = 0;
@@ -214,16 +270,18 @@ namespace types
                     int iPos    = getIndex(_piDims);
 
                     addSignedIntValue(&ostemp, get(iPos), piSize[iCols2]);
-                    ostemp << SPACE_BETWEEN_TWO_VALUES;
                 }
                 ostemp << std::endl;
             }
-            if(iLastCol != 0)
+
+            if(m_iRows2PrintState == 0 && iLastCol != 0)
             {
                 ostr << std::endl << L"       column " << iLastCol + 1 << L" to " << getCols() << std::endl << std::endl;
             }
             ostr << ostemp.str();
         }
+
+        return true;
     }
 
     bool Int32::operator==(const InternalType& it)
index b4d7f5d..c58de70 100644 (file)
@@ -84,11 +84,12 @@ namespace types
         std::cout << "types::Int64";
     }
 
-    void Int64::subMatrixToString(std::wostringstream& ostr, int* _piDims, int _iDims)
+    bool Int64::subMatrixToString(std::wostringstream& ostr, int* _piDims, int _iDims)
     {
+        int iCurrentLine = 0;
         int iLineLen = getConsoleWidth();
-        ostr << std::endl;
-        /*Comment tenir compte de la longueur des lignes dans le formatage de variable ? */
+        int iMaxLines = getConsoleLines();
+
         if(isScalar())
         {//scalar
             int iWidth  = 0;
@@ -102,25 +103,42 @@ namespace types
         }
         else if(getCols() == 1)
         {//column vector
+            int iWidthMax = 0;
 
+            //Array with the max printed size of each col
             for(int i = 0 ; i < getRows() ; i++)
             {
-                int iWidth  = 0;
+                _piDims[1] = 0;
+                _piDims[0] = i;
+                int iWidth = 0;
+                int iPos = getIndex(_piDims);
+                getSignedIntFormat(get(iPos), &iWidth);
+                iWidthMax = Max(iWidthMax, iWidth);
+            }
+
+            for(int i = m_iRows1PrintState ; i < getRows() ; i++)
+            {
+                iCurrentLine++;
+                if((iMaxLines == 0 && iCurrentLine >= MAX_LINES) || (iMaxLines != 0 && iCurrentLine >= iMaxLines))
+                {
+                    m_iRows1PrintState = i;
+                    return false;
+                }
+
                 _piDims[1]  = 0;
                 _piDims[0]  = i;
                 int iPos    = getIndex(_piDims);
 
-                getSignedIntFormat(get(iPos), &iWidth);
-                addSignedIntValue(&ostr, get(iPos), iWidth);
+                addSignedIntValue(&ostr, get(iPos), iWidthMax);
                 ostr << std::endl;
             }
         }
         else if(getRows() == 1)
         {//row vector
             std::wostringstream ostemp;
-            int iLastVal = 0;
+            int iLastVal = m_iCols1PrintState;
 
-            for(int i = 0 ; i < getCols() ; i++)
+            for(int i = m_iCols1PrintState ; i < getCols() ; i++)
             {
                 int iWidth  = 0;
                 int iLen    = 0;
@@ -132,17 +150,19 @@ namespace types
                 iLen = iWidth + static_cast<int>(ostemp.str().size());
                 if(iLen > iLineLen)
                 {//Max length, new line
+                    iCurrentLine += 4; //"column x to Y" + empty line + value + empty line
+                    if((iMaxLines == 0 && iCurrentLine >= MAX_LINES) || (iMaxLines != 0 && iCurrentLine >= iMaxLines))
+                    {
+                        m_iCols1PrintState = iLastVal;
+                        return false;
+                    }
+
                     ostr << std::endl << L"       column " << iLastVal + 1 << L" to " << i << std::endl << std::endl;
                     ostr << ostemp.str() << std::endl;
                     ostemp.str(L"");
                     iLastVal = i;
                 }
 
-                if(ostemp.str().size() != 0)
-                {
-                    ostemp << SPACE_BETWEEN_TWO_VALUES;
-                }
-
                 addSignedIntValue(&ostemp, get(iPos), iWidth);
             }
 
@@ -157,14 +177,14 @@ namespace types
         {
             std::wostringstream ostemp;
             int iLen = 0;
-            int iLastCol = 0;
+            int iLastCol = m_iCols1PrintState;
 
             //Array with the max printed size of each col
             int *piSize = new int[getCols()];
             memset(piSize, 0x00, getCols() * sizeof(int));
 
             //compute the row size for padding for each printed bloc.
-            for(int iCols1 = 0 ; iCols1 < getCols() ; iCols1++)
+            for(int iCols1 = m_iCols1PrintState ; iCols1 < getCols() ; iCols1++)
             {
                 for(int iRows1 = 0 ; iRows1 < getRows() ; iRows1++)
                 {
@@ -179,8 +199,23 @@ namespace types
 
                 if(iLen + piSize[iCols1] > iLineLen)
                 {//find the limit, print this part
-                    for(int iRows2 = 0 ; iRows2 < getRows() ; iRows2++)
+                    for(int iRows2 = m_iRows2PrintState ; iRows2 < getRows() ; iRows2++)
                     {
+                        iCurrentLine++;
+                        if((iMaxLines == 0 && iCurrentLine >= MAX_LINES) ||
+                            ( (iMaxLines != 0 && iCurrentLine + 3 >= iMaxLines && iRows2 == m_iRows2PrintState) || 
+                            (iMaxLines != 0 && iCurrentLine + 1 >= iMaxLines && iRows2 != m_iRows2PrintState)))
+                        {
+                            if(m_iRows2PrintState == 0 && iRows2 != 0)
+                            {//add header
+                                ostr << std::endl << L"       column " << iLastCol + 1 << L" to " << iCols1 << std::endl << std::endl;
+                            }
+                            ostr << ostemp.str();
+                            m_iRows2PrintState = iRows2;
+                            m_iCols1PrintState = iLastCol;
+                            return false;
+                        }
+
                         for(int iCols2 = iLastCol ; iCols2 < iCols1 ; iCols2++)
                         {
                             int iWidth  = 0;
@@ -189,22 +224,44 @@ namespace types
                             int iPos    = getIndex(_piDims);
 
                             addSignedIntValue(&ostemp, get(iPos), piSize[iCols2]);
-                            ostemp << SPACE_BETWEEN_TWO_VALUES;
                         }
                         ostemp << std::endl;
                     }
                     iLen = 0;
-                    ostr << std::endl << L"       column " << iLastCol + 1 << L" to " << iCols1 << std::endl << std::endl;;
+
+                    iCurrentLine++;
+                    if(m_iRows2PrintState == 0)
+                    {
+                        iCurrentLine += 3;
+                        ostr << std::endl << L"       column " << iLastCol + 1 << L" to " << iCols1 << std::endl << std::endl;
+                    }
+                    
                     ostr << ostemp.str();
                     ostemp.str(L"");
                     iLastCol = iCols1;
-
+                    m_iRows2PrintState = 0;
+                    m_iCols1PrintState = 0;
                 }
+
                 iLen += piSize[iCols1] + SIGN_LENGTH + SIZE_BETWEEN_TWO_VALUES;
             }
 
-            for(int iRows2 = 0 ; iRows2 < getRows() ; iRows2++)
+            for(int iRows2 = m_iRows2PrintState ; iRows2 < getRows() ; iRows2++)
             {
+                iCurrentLine++;
+                if((iMaxLines == 0 && iCurrentLine >= MAX_LINES) || (iMaxLines != 0 && iCurrentLine >= iMaxLines))
+                {
+                    if(m_iRows2PrintState == 0 && iLastCol != 0)
+                    {//add header
+                        ostr << std::endl << L"       column " << iLastCol + 1 << L" to " << getCols() << std::endl << std::endl;
+                    }
+
+                    ostr << ostemp.str();
+                    m_iRows2PrintState = iRows2;
+                    m_iCols1PrintState = iLastCol;
+                    return false;
+                }
+
                 for(int iCols2 = iLastCol ; iCols2 < getCols() ; iCols2++)
                 {
                     int iWidth  = 0;
@@ -213,16 +270,18 @@ namespace types
                     int iPos    = getIndex(_piDims);
 
                     addSignedIntValue(&ostemp, get(iPos), piSize[iCols2]);
-                    ostemp << SPACE_BETWEEN_TWO_VALUES;
                 }
                 ostemp << std::endl;
             }
-            if(iLastCol != 0)
+
+            if(m_iRows2PrintState == 0 && iLastCol != 0)
             {
                 ostr << std::endl << L"       column " << iLastCol + 1 << L" to " << getCols() << std::endl << std::endl;
             }
             ostr << ostemp.str();
         }
+
+        return true;
     }
 
     bool Int64::operator==(const InternalType& it)
index 48a4dc1..038bea0 100644 (file)
@@ -84,12 +84,12 @@ namespace types
         std::cout << "types::Int8";
     }
 
-    void Int8::subMatrixToString(std::wostringstream& ostr, int* _piDims, int _iDims)
+    bool Int8::subMatrixToString(std::wostringstream& ostr, int* _piDims, int _iDims)
     {
+        int iCurrentLine = 0;
         int iLineLen = getConsoleWidth();
+        int iMaxLines = getConsoleLines();
 
-        ostr << std::endl;
-        /*Comment tenir compte de la longueur des lignes dans le formatage de variable ? */
         if(isScalar())
         {//scalar
             int iWidth  = 0;
@@ -103,25 +103,42 @@ namespace types
         }
         else if(getCols() == 1)
         {//column vector
+            int iWidthMax = 0;
 
+            //Array with the max printed size of each col
             for(int i = 0 ; i < getRows() ; i++)
             {
-                int iWidth  = 0;
+                _piDims[1] = 0;
+                _piDims[0] = i;
+                int iWidth = 0;
+                int iPos = getIndex(_piDims);
+                getSignedIntFormat(get(iPos), &iWidth);
+                iWidthMax = Max(iWidthMax, iWidth);
+            }
+
+            for(int i = m_iRows1PrintState ; i < getRows() ; i++)
+            {
+                iCurrentLine++;
+                if((iMaxLines == 0 && iCurrentLine >= MAX_LINES) || (iMaxLines != 0 && iCurrentLine >= iMaxLines))
+                {
+                    m_iRows1PrintState = i;
+                    return false;
+                }
+
                 _piDims[1]  = 0;
                 _piDims[0]  = i;
                 int iPos    = getIndex(_piDims);
 
-                getSignedIntFormat(get(iPos), &iWidth);
-                addSignedIntValue(&ostr, get(iPos), iWidth);
+                addSignedIntValue(&ostr, get(iPos), iWidthMax);
                 ostr << std::endl;
             }
         }
         else if(getRows() == 1)
         {//row vector
             std::wostringstream ostemp;
-            int iLastVal = 0;
+            int iLastVal = m_iCols1PrintState;
 
-            for(int i = 0 ; i < getCols() ; i++)
+            for(int i = m_iCols1PrintState ; i < getCols() ; i++)
             {
                 int iWidth  = 0;
                 int iLen    = 0;
@@ -133,17 +150,19 @@ namespace types
                 iLen = iWidth + static_cast<int>(ostemp.str().size());
                 if(iLen > iLineLen)
                 {//Max length, new line
+                    iCurrentLine += 4; //"column x to Y" + empty line + value + empty line
+                    if((iMaxLines == 0 && iCurrentLine >= MAX_LINES) || (iMaxLines != 0 && iCurrentLine >= iMaxLines))
+                    {
+                        m_iCols1PrintState = iLastVal;
+                        return false;
+                    }
+
                     ostr << std::endl << L"       column " << iLastVal + 1 << L" to " << i << std::endl << std::endl;
                     ostr << ostemp.str() << std::endl;
                     ostemp.str(L"");
                     iLastVal = i;
                 }
 
-                if(ostemp.str().size() != 0)
-                {
-                    ostemp << SPACE_BETWEEN_TWO_VALUES;
-                }
-
                 addSignedIntValue(&ostemp, get(iPos), iWidth);
             }
 
@@ -158,14 +177,14 @@ namespace types
         {
             std::wostringstream ostemp;
             int iLen = 0;
-            int iLastCol = 0;
+            int iLastCol = m_iCols1PrintState;
 
             //Array with the max printed size of each col
             int *piSize = new int[getCols()];
             memset(piSize, 0x00, getCols() * sizeof(int));
 
             //compute the row size for padding for each printed bloc.
-            for(int iCols1 = 0 ; iCols1 < getCols() ; iCols1++)
+            for(int iCols1 = m_iCols1PrintState ; iCols1 < getCols() ; iCols1++)
             {
                 for(int iRows1 = 0 ; iRows1 < getRows() ; iRows1++)
                 {
@@ -180,8 +199,23 @@ namespace types
 
                 if(iLen + piSize[iCols1] > iLineLen)
                 {//find the limit, print this part
-                    for(int iRows2 = 0 ; iRows2 < getRows() ; iRows2++)
+                    for(int iRows2 = m_iRows2PrintState ; iRows2 < getRows() ; iRows2++)
                     {
+                        iCurrentLine++;
+                        if((iMaxLines == 0 && iCurrentLine >= MAX_LINES) ||
+                            ( (iMaxLines != 0 && iCurrentLine + 3 >= iMaxLines && iRows2 == m_iRows2PrintState) || 
+                            (iMaxLines != 0 && iCurrentLine + 1 >= iMaxLines && iRows2 != m_iRows2PrintState)))
+                        {
+                            if(m_iRows2PrintState == 0 && iRows2 != 0)
+                            {//add header
+                                ostr << std::endl << L"       column " << iLastCol + 1 << L" to " << iCols1 << std::endl << std::endl;
+                            }
+                            ostr << ostemp.str();
+                            m_iRows2PrintState = iRows2;
+                            m_iCols1PrintState = iLastCol;
+                            return false;
+                        }
+
                         for(int iCols2 = iLastCol ; iCols2 < iCols1 ; iCols2++)
                         {
                             int iWidth  = 0;
@@ -190,22 +224,44 @@ namespace types
                             int iPos    = getIndex(_piDims);
 
                             addSignedIntValue(&ostemp, get(iPos), piSize[iCols2]);
-                            ostemp << SPACE_BETWEEN_TWO_VALUES;
                         }
                         ostemp << std::endl;
                     }
                     iLen = 0;
-                    ostr << std::endl << L"       column " << iLastCol + 1 << L" to " << iCols1 << std::endl << std::endl;;
+
+                    iCurrentLine++;
+                    if(m_iRows2PrintState == 0)
+                    {
+                        iCurrentLine += 3;
+                        ostr << std::endl << L"       column " << iLastCol + 1 << L" to " << iCols1 << std::endl << std::endl;
+                    }
+                    
                     ostr << ostemp.str();
                     ostemp.str(L"");
                     iLastCol = iCols1;
-
+                    m_iRows2PrintState = 0;
+                    m_iCols1PrintState = 0;
                 }
+
                 iLen += piSize[iCols1] + SIGN_LENGTH + SIZE_BETWEEN_TWO_VALUES;
             }
 
-            for(int iRows2 = 0 ; iRows2 < getRows() ; iRows2++)
+            for(int iRows2 = m_iRows2PrintState ; iRows2 < getRows() ; iRows2++)
             {
+                iCurrentLine++;
+                if((iMaxLines == 0 && iCurrentLine >= MAX_LINES) || (iMaxLines != 0 && iCurrentLine >= iMaxLines))
+                {
+                    if(m_iRows2PrintState == 0 && iLastCol != 0)
+                    {//add header
+                        ostr << std::endl << L"       column " << iLastCol + 1 << L" to " << getCols() << std::endl << std::endl;
+                    }
+
+                    ostr << ostemp.str();
+                    m_iRows2PrintState = iRows2;
+                    m_iCols1PrintState = iLastCol;
+                    return false;
+                }
+
                 for(int iCols2 = iLastCol ; iCols2 < getCols() ; iCols2++)
                 {
                     int iWidth  = 0;
@@ -214,16 +270,18 @@ namespace types
                     int iPos    = getIndex(_piDims);
 
                     addSignedIntValue(&ostemp, get(iPos), piSize[iCols2]);
-                    ostemp << SPACE_BETWEEN_TWO_VALUES;
                 }
                 ostemp << std::endl;
             }
-            if(iLastCol != 0)
+
+            if(m_iRows2PrintState == 0 && iLastCol != 0)
             {
                 ostr << std::endl << L"       column " << iLastCol + 1 << L" to " << getCols() << std::endl << std::endl;
             }
             ostr << ostemp.str();
         }
+
+        return true;
     }
 
     bool Int8::operator==(const InternalType& it)
index c9b53a6..97d0a36 100644 (file)
@@ -124,10 +124,8 @@ namespace types
     ** toString to display Lists
     ** FIXME : Find a better indentation process
     */
-    std::wstring List::toString()
+    bool List::toString(std::wostringstream& ostr)
     {
-        std::wostringstream ostr;
-
         if (getSize() == 0)
         {
             ostr << L"()" << std::endl;
@@ -139,10 +137,12 @@ namespace types
             for (itValues = m_plData->begin() ; itValues != m_plData->end() ; ++itValues, ++iPosition)
             {
                 ostr << L"     (" << iPosition << L")" << std::endl;
-                ostr << (*itValues)->toString() << std::endl;
+                //maange lines
+                bool bFinish = (*itValues)->toString(ostr);
+                ostr << std::endl;
             }
         }
-        return ostr.str();
+        return true;
     }
 
     std::vector<InternalType*> List::extract(typed_list* _pArgs)
index e081585..15d223b 100644 (file)
@@ -37,13 +37,9 @@ namespace types
                return RealListDeleteOperation;
        }
 
-    std::wstring ListDelete::toString()
-       {
-        std::wostringstream ostr;
-
-         //FIXME : Implement me.
-         ostr << L"FIXME : Implement ListDelete::toString" << std::endl;
-
-         return ostr.str();
-       }
+    bool ListDelete::toString(std::wostringstream& ostr)
+    {
+        ostr << L"FIXME : Implement ListDelete::toString" << std::endl;
+        return true;
+    }
 }
index 7e0f94c..fad1785 100644 (file)
@@ -53,13 +53,10 @@ namespace types
         return RealListInsertOperation;
     }
 
-    std::wstring ListInsert::toString()
+    bool ListInsert::toString(std::wostringstream& ostr)
     {
-        std::wostringstream ostr;
-
-        //FIXME : Implement me.
         ostr << L"FIXME : Implement ListInsert::toString" << std::endl;
-        return ostr.str();
+        return true;
     }
 
     InternalType* ListInsert::getInsert()
index 3b38941..2e2b16f 100644 (file)
@@ -37,13 +37,9 @@ namespace types
                return RealListOperation;
        }
 
-    std::wstring ListOperation::toString()
-       {
-        std::wostringstream ostr;
-
-         //FIXME : Implement me.
-         ostr << L"FIXME : Implement ListOperation::toString" << std::endl;
-
-         return ostr.str();
-       }
+    bool ListOperation::toString(std::wostringstream& ostr)
+    {
+        ostr << L"FIXME : Implement ListOperation::toString" << std::endl;
+        return true;
+    }
 }
index 50c0bd7..85effbe 100644 (file)
@@ -37,13 +37,9 @@ namespace types
                return RealListUndefinedOperation;
        }
 
-    std::wstring ListUndefined::toString()
-       {
-        std::wostringstream ostr;
-
-         //FIXME : Implement me.
-         ostr << L"    Undefined" << std::endl;
-
-         return ostr.str();
-       }
+    bool ListUndefined::toString(std::wostringstream& ostr)
+    {
+        ostr << L"    Undefined" << std::endl;
+        return true;
+    }
 }
index e939e29..2b557e0 100644 (file)
@@ -70,14 +70,10 @@ namespace types
         return m_body;
     }
 
-    wstring Macro::toString()
+    bool Macro::toString(std::wostringstream& ostr)
     {
-        wostringstream ostr;
-
-        //FIXME : Implement me.
         ostr << L"FIXME : Implement Macro::toString" << std::endl;
-
-        return ostr.str();
+        return true;
     }
 
     Callable::ReturnValue Macro::call(typed_list &in, int _iRetCount, typed_list &out, ast::ConstVisitor* execFunc)
index 368658a..f4761eb 100644 (file)
@@ -52,14 +52,10 @@ namespace types
         return RealMacroFile; 
     }
 
-    wstring MacroFile::toString()
+    bool MacroFile::toString(std::wostringstream& ostr)
     {
-        wostringstream ostr;
-
-        // FIXME : Implement me.
         ostr << L"FIXME : Implement MacroFile::toString" << std::endl;
-
-        return ostr.str();
+        return true;
     }
 
     Callable::ReturnValue MacroFile::call(typed_list &in, int _iRetCount, typed_list &out, ast::ConstVisitor* execFunc)
index 205160d..efa2839 100644 (file)
@@ -364,7 +364,7 @@ namespace types
         }
     }
 
-    void Polynom::subMatrixToString(std::wostringstream& ostr, int* _piDims, int _iDims)
+    bool Polynom::subMatrixToString(std::wostringstream& ostr, int* _piDims, int _iDims)
     {
         int iPrecision = getFormatSize();
         int iLineLen = getConsoleWidth();
@@ -446,7 +446,7 @@ namespace types
                 ostr << getMatrixString(_piDims, _iDims, false);
             }
         }
-        ostr << endl;
+        return true;
     }
 
     wstring Polynom::getMatrixString(int* _piDims, int _iDims, bool _bComplex)
index ee0372c..5d1fe0c 100644 (file)
@@ -340,15 +340,11 @@ namespace types
                }
        }
 
-       wstring SinglePoly::toString()
-       {
-         wostringstream ostr;
-
-         // FIXME : implement this.
-         ostr << L"FIXME : implement SinglePoly::toString" << std::endl;
-
-         return ostr.str();
-       }
+    bool SinglePoly::toString(std::wostringstream& ostr)
+    {
+        ostr << L"FIXME : implement SinglePoly::toString" << std::endl;
+        return true;
+    }
 
        void SinglePoly::toStringReal(wstring _szVar, list<wstring>* _pListExp , list<wstring>* _pListCoef)
        {
index 524d8dd..3a377ac 100644 (file)
@@ -186,11 +186,12 @@ namespace types
         return pOut;
     }
 
-    std::wstring SingleStruct::toString()
+    bool SingleStruct::toString(std::wostringstream& ostr)
     {
         if(m_pData->size() == 0)
         {
-            return L"empty SingleStruct";
+            ostr << L"empty SingleStruct";
+            return true;
         }
         else
         {
@@ -201,9 +202,9 @@ namespace types
             {
                 str += (*itValues).first + L" : " + (*itValues).second->getTypeStr() + L"\n";
             }
-            return str;
+            ostr << str;
         }
-        return L"";
+        return true;
     }
 
     bool SingleStruct::addField(const std::wstring& _sKey)
index 1f7fa8d..5945949 100644 (file)
@@ -546,7 +546,7 @@ namespace types
     }
 
     // TODO: handle precision and line length
-    std::wstring Sparse::toString() const
+    bool Sparse::toString(std::wostringstream& ostr) const
     {
         int iPrecision = getFormatSize();
         std::wstring res;
@@ -558,7 +558,9 @@ namespace types
         {
             res = ::toString(*matrixCplx, iPrecision);
         }
-        return res;
+
+        ostr << res;
+        return true;
     }
 
     bool Sparse::resize(int _iNewRows, int _iNewCols)
@@ -1404,9 +1406,10 @@ namespace types
     }
 
 
-    std::wstring  SparseBool::toString() const
+    bool SparseBool::toString(std::wostringstream& ostr) const
     {
-        return ::toString(*matrixBool, 0);
+        ostr << ::toString(*matrixBool, 0);
+        return true;
     }
 
     void SparseBool::whoAmI() CONST
index 09ae0eb..4464b59 100644 (file)
@@ -139,10 +139,12 @@ namespace types
                return GenericType::RealString;
        }
 
-    void String::subMatrixToString(wostringstream& ostr, int* _piDims, int _iDims)
+    bool String::subMatrixToString(wostringstream& ostr, int* _piDims, int _iDims)
        {
         int iPrecision = getFormatSize();
         int iLineLen = getConsoleWidth();
+        int iMaxLines = getConsoleLines();
+        int iCurrentLine = 0;
 
                if(isScalar())
                {
@@ -164,8 +166,15 @@ namespace types
 
                        iMaxLen += 2;
 
-                       for(int i = 0 ; i < getRows() ; i++)
+            for(int i = m_iRows1PrintState ; i < getRows() ; i++)
                        {
+                iCurrentLine += 2;
+                if((iMaxLines == 0 && iCurrentLine >= MAX_LINES) || (iMaxLines != 0 && iCurrentLine >= iMaxLines))
+                {
+                    m_iRows1PrintState = i;
+                    return false;
+                }
+
                 _piDims[1] = 0;
                 _piDims[0] = i;
                 int iPos = getIndex(_piDims);
@@ -175,7 +184,7 @@ namespace types
                                ostr << left << get(iPos);
                                ostr << L"!" << endl;
                                if((i+1) < m_iSize)
-                               {
+                               {//for all but last one
                                        ostr << L"!";
                                        configureStream(&ostr, iMaxLen, iPrecision, ' ');
                                        ostr << left << L" ";
@@ -186,8 +195,9 @@ namespace types
                else if(getRows() == 1)
                {
                        wostringstream ostemp;
-                       int iLastVal = 0;
-                       for(int i = 0 ; i < getCols() ; i++)
+                       int iLastVal = m_iCols1PrintState;
+
+                       for(int i = m_iCols1PrintState ; i < getCols() ; i++)
                        {
                 _piDims[0] = 0;
                 _piDims[1] = i;
@@ -198,15 +208,15 @@ namespace types
                                iLen = iCurLen + SIZE_BETWEEN_TWO_VALUES + static_cast<int>(ostemp.str().size());
                                if(iLen > iLineLen)
                                {//Max length, new line
-                                       if(iLastVal + 1 == i)
-                                       {
-                                               ostr << endl << L"       column " << iLastVal + 1 << endl << endl;
-                                       }
-                                       else
-                                       {
-                                               ostr << endl << L"       column " << iLastVal + 1 << L" to " << i << endl << endl;
-                                       }
-                                       ostr << ostemp.str() << L"!" << endl;
+                    iCurrentLine += 4; //"column x to Y" + empty line + value + empty line
+                    if((iMaxLines == 0 && iCurrentLine >= MAX_LINES) || (iMaxLines != 0 && iCurrentLine >= iMaxLines))
+                    {
+                        m_iCols1PrintState = iLastVal;
+                        return false;
+                    }
+                                       
+                    ostr << endl << L"       column " << iLastVal + 1 << L" to " << i << endl << endl;
+                                       ostr << L"!" << ostemp.str() << L"!" << endl;
                                        ostemp.str(L"");
                                        iLastVal = i;
                                }
@@ -217,14 +227,7 @@ namespace types
 
                        if(iLastVal != 0)
                        {
-                               if(iLastVal + 1 == m_iCols)
-                               {
-                                       ostr << endl << L"       column " << iLastVal + 1 << endl << endl;
-                               }
-                               else
-                               {
-                                       ostr << endl << L"       column " << iLastVal + 1 << L" to " << m_iCols << endl << endl;
-                               }
+                ostr << endl << L"       column " << iLastVal + 1 << L" to " << getCols() << endl << endl;
                        }
                        ostr << L"!" << ostemp.str() << L"!" << endl;
                }
@@ -232,13 +235,13 @@ namespace types
                {
                        wostringstream ostemp;
                        int iLen = 0;
-                       int iLastCol = 0;
+                       int iLastCol = m_iCols1PrintState;
 
                        //Array with the max printed size of each col
                        int *piSize = new int[getCols()];
                        memset(piSize, 0x00, getCols() * sizeof(int));
 
-                       for(int iCols1 = 0 ; iCols1 < getCols() ; iCols1++)
+                       for(int iCols1 = m_iCols1PrintState ; iCols1 < getCols() ; iCols1++)
                        {
                                for(int iRows1 = 0 ; iRows1 < getRows() ; iRows1++)
                                {
@@ -250,9 +253,24 @@ namespace types
 
                                if(iLen + piSize[iCols1] > iLineLen)
                                {//find the limit, print this part
-                                       for(int iRows2 = 0 ; iRows2 < getRows() ; iRows2++)
+                                       for(int iRows2 = m_iRows2PrintState ; iRows2 < getRows() ; iRows2++)
                                        {
-                                               ostemp << L"!";
+                        iCurrentLine += 2;
+                        if((iMaxLines == 0 && iCurrentLine >= MAX_LINES) ||
+                            ( (iMaxLines != 0 && iCurrentLine + 3 >= iMaxLines && iRows2 == m_iRows2PrintState) || 
+                            (iMaxLines != 0 && iCurrentLine + 1 >= iMaxLines && iRows2 != m_iRows2PrintState)))
+                        {
+                            if(m_iRows2PrintState == 0 && iRows2 != 0)
+                            {//add header
+                                ostr << std::endl << L"       column " << iLastCol + 1 << L" to " << iCols1 << std::endl << std::endl;
+                            }
+                            ostr << ostemp.str();
+                            m_iRows2PrintState = iRows2;
+                            m_iCols1PrintState = iLastCol;
+                            return false;
+                        }
+
+                        ostemp << L"!";
                                                for(int iCols2 = iLastCol ; iCols2 < iCols1 ; iCols2++)
                                                {
                             _piDims[0] = iRows2;
@@ -273,26 +291,40 @@ namespace types
                                        }
 
                                        iLen = 0;
-                                       if(iCols1 + 1 == m_iCols)
-                                       {
-                                               ostr << endl << L"       column " << iCols1 << endl << endl;
-                                       }
-                                       else
-                                       {
-                                               ostr << endl << L"       column " << iLastCol + 1 << L" to " << iCols1 << endl << endl;
-                                       }
+                    iCurrentLine += 2;
+                    if(m_iRows2PrintState == 0)
+                    {
+                        iCurrentLine += 3;
+                        ostr << std::endl << L"       column " << iLastCol + 1 << L" to " << iCols1 << std::endl << std::endl;
+                    }
                                        ostr << ostemp.str();
                                        ostemp.str(L"");
                                        iLastCol = iCols1;
+                    m_iRows2PrintState = 0;
+                    m_iCols1PrintState = 0;
                                }
                                iLen += piSize[iCols1] + SIZE_BETWEEN_TWO_VALUES;
                        }
 
-                       for(int iRows2 = 0 ; iRows2 < getRows() ; iRows2++)
+                       for(int iRows2 = m_iRows2PrintState ; iRows2 < getRows() ; iRows2++)
                        {
-                               iLen = 0;
-                               ostemp << L"!";
-                               for(int iCols2 = iLastCol ; iCols2 < getCols() ; iCols2++)
+                iCurrentLine += 2;
+                if((iMaxLines == 0 && iCurrentLine >= MAX_LINES) || (iMaxLines != 0 && iCurrentLine >= iMaxLines))
+                {
+                    if(m_iRows2PrintState == 0 && iLastCol != 0)
+                    {//add header
+                        ostr << std::endl << L"       column " << iLastCol + 1 << L" to " << getCols() << std::endl << std::endl;
+                    }
+
+                    ostr << ostemp.str();
+                    m_iRows2PrintState = iRows2;
+                    m_iCols1PrintState = iLastCol;
+                    return false;
+                }
+
+                ostemp << L"!";
+                iLen = 0;
+                for(int iCols2 = iLastCol ; iCols2 < getCols() ; iCols2++)
                                {
                     _piDims[0] = iRows2;
                     _piDims[1] = iCols2;
@@ -312,19 +344,14 @@ namespace types
                                }
                        }
 
-                       if(iLastCol != 0)
-                       {
-                               if(iLastCol + 1 == m_iCols)
-                               {
-                                       ostr << endl << L"       column " << m_iCols << endl << endl;
-                               }
-                               else
-                               {
-                                       ostr << endl << L"       column " << iLastCol + 1 << L" to " << m_iCols << endl << endl;
-                               }
-                       }
-                       ostr << ostemp.str();
-               }
+            if(m_iRows2PrintState == 0 && iLastCol != 0)
+            {
+                ostr << std::endl << L"       column " << iLastCol + 1 << L" to " << getCols() << std::endl << std::endl;
+            }
+            ostr << ostemp.str();
+        }
+
+        return true;
        }
 
        bool String::operator==(const InternalType& it)
index 960f76c..961d07f 100644 (file)
@@ -298,8 +298,9 @@ namespace types
         return pData;
    }
 
-    void Struct::subMatrixToString(std::wostringstream& ostr, int* _piDims, int _iDims)
+    bool Struct::subMatrixToString(std::wostringstream& ostr, int* _piDims, int _iDims)
     {
+        return true;
     }
 
     bool Struct::addField(const std::wstring& _sKey)
@@ -324,10 +325,8 @@ namespace types
         return true;
     }
 
-    std::wstring Struct::toString()
+    bool Struct::toString(std::wostringstream& ostr)
     {
-        std::wostringstream ostr;
-
         if(getSize() == 0)
         {
             ostr << L"0x0 struct array with no field.";
@@ -375,7 +374,7 @@ namespace types
             delete pwstFields;
         }
 
-        return ostr.str();
+        return true;
     }
 
     std::vector<InternalType*> Struct::extractFields(std::list<std::wstring> _wstFields)
index 0807765..ba42412 100644 (file)
@@ -141,14 +141,11 @@ namespace types
 #endif
     }
 
-    std::wstring ThreadId::toString()
+    bool ThreadId::toString(std::wostringstream& ostr)
     {
-        std::wostringstream ostr;
-
         ostr << L"ThreadId : " << this << std::endl;
         ostr << L"Status : " << StatusToString(this->getStatus());
-
-        return ostr.str();
+        return true;
     }
 }
 
index 17f4625..b6b44df 100644 (file)
@@ -84,11 +84,12 @@ namespace types
         std::cout << "types::UInt16";
     }
 
-    void UInt16::subMatrixToString(std::wostringstream& ostr, int* _piDims, int _iDims)
+    bool UInt16::subMatrixToString(std::wostringstream& ostr, int* _piDims, int _iDims)
     {
+        int iCurrentLine = 0;
         int iLineLen = getConsoleWidth();
-        ostr << std::endl;
-        /*Comment tenir compte de la longueur des lignes dans le formatage de variable ? */
+        int iMaxLines = getConsoleLines();
+
         if(isScalar())
         {//scalar
             int iWidth  = 0;
@@ -102,25 +103,42 @@ namespace types
         }
         else if(getCols() == 1)
         {//column vector
+            int iWidthMax = 0;
 
+            //Array with the max printed size of each col
             for(int i = 0 ; i < getRows() ; i++)
             {
-                int iWidth  = 0;
+                _piDims[1] = 0;
+                _piDims[0] = i;
+                int iWidth = 0;
+                int iPos = getIndex(_piDims);
+                getUnsignedIntFormat(get(iPos), &iWidth);
+                iWidthMax = Max(iWidthMax, iWidth);
+            }
+
+            for(int i = m_iRows1PrintState ; i < getRows() ; i++)
+            {
+                iCurrentLine++;
+                if((iMaxLines == 0 && iCurrentLine >= MAX_LINES) || (iMaxLines != 0 && iCurrentLine >= iMaxLines))
+                {
+                    m_iRows1PrintState = i;
+                    return false;
+                }
+
                 _piDims[1]  = 0;
                 _piDims[0]  = i;
                 int iPos    = getIndex(_piDims);
 
-                getUnsignedIntFormat(get(iPos), &iWidth);
-                addUnsignedIntValue(&ostr, get(iPos), iWidth);
+                addUnsignedIntValue(&ostr, get(iPos), iWidthMax);
                 ostr << std::endl;
             }
         }
         else if(getRows() == 1)
         {//row vector
             std::wostringstream ostemp;
-            int iLastVal = 0;
+            int iLastVal = m_iCols1PrintState;
 
-            for(int i = 0 ; i < getCols() ; i++)
+            for(int i = m_iCols1PrintState ; i < getCols() ; i++)
             {
                 int iWidth  = 0;
                 int iLen    = 0;
@@ -132,17 +150,19 @@ namespace types
                 iLen = iWidth + static_cast<int>(ostemp.str().size());
                 if(iLen > iLineLen)
                 {//Max length, new line
+                    iCurrentLine += 4; //"column x to Y" + empty line + value + empty line
+                    if((iMaxLines == 0 && iCurrentLine >= MAX_LINES) || (iMaxLines != 0 && iCurrentLine >= iMaxLines))
+                    {
+                        m_iCols1PrintState = iLastVal;
+                        return false;
+                    }
+
                     ostr << std::endl << L"       column " << iLastVal + 1 << L" to " << i << std::endl << std::endl;
                     ostr << ostemp.str() << std::endl;
                     ostemp.str(L"");
                     iLastVal = i;
                 }
 
-                if(ostemp.str().size() != 0)
-                {
-                    ostemp << SPACE_BETWEEN_TWO_VALUES;
-                }
-
                 addUnsignedIntValue(&ostemp, get(iPos), iWidth);
             }
 
@@ -157,14 +177,14 @@ namespace types
         {
             std::wostringstream ostemp;
             int iLen = 0;
-            int iLastCol = 0;
+            int iLastCol = m_iCols1PrintState;
 
             //Array with the max printed size of each col
             int *piSize = new int[getCols()];
             memset(piSize, 0x00, getCols() * sizeof(int));
 
             //compute the row size for padding for each printed bloc.
-            for(int iCols1 = 0 ; iCols1 < getCols() ; iCols1++)
+            for(int iCols1 = m_iCols1PrintState ; iCols1 < getCols() ; iCols1++)
             {
                 for(int iRows1 = 0 ; iRows1 < getRows() ; iRows1++)
                 {
@@ -179,8 +199,23 @@ namespace types
 
                 if(iLen + piSize[iCols1] > iLineLen)
                 {//find the limit, print this part
-                    for(int iRows2 = 0 ; iRows2 < getRows() ; iRows2++)
+                    for(int iRows2 = m_iRows2PrintState ; iRows2 < getRows() ; iRows2++)
                     {
+                        iCurrentLine++;
+                        if((iMaxLines == 0 && iCurrentLine >= MAX_LINES) ||
+                            ( (iMaxLines != 0 && iCurrentLine + 3 >= iMaxLines && iRows2 == m_iRows2PrintState) || 
+                            (iMaxLines != 0 && iCurrentLine + 1 >= iMaxLines && iRows2 != m_iRows2PrintState)))
+                        {
+                            if(m_iRows2PrintState == 0 && iRows2 != 0)
+                            {//add header
+                                ostr << std::endl << L"       column " << iLastCol + 1 << L" to " << iCols1 << std::endl << std::endl;
+                            }
+                            ostr << ostemp.str();
+                            m_iRows2PrintState = iRows2;
+                            m_iCols1PrintState = iLastCol;
+                            return false;
+                        }
+
                         for(int iCols2 = iLastCol ; iCols2 < iCols1 ; iCols2++)
                         {
                             int iWidth  = 0;
@@ -189,22 +224,44 @@ namespace types
                             int iPos    = getIndex(_piDims);
 
                             addUnsignedIntValue(&ostemp, get(iPos), piSize[iCols2]);
-                            ostemp << SPACE_BETWEEN_TWO_VALUES;
                         }
                         ostemp << std::endl;
                     }
                     iLen = 0;
-                    ostr << std::endl << L"       column " << iLastCol + 1 << L" to " << iCols1 << std::endl << std::endl;;
+
+                    iCurrentLine++;
+                    if(m_iRows2PrintState == 0)
+                    {
+                        iCurrentLine += 3;
+                        ostr << std::endl << L"       column " << iLastCol + 1 << L" to " << iCols1 << std::endl << std::endl;
+                    }
+                    
                     ostr << ostemp.str();
                     ostemp.str(L"");
                     iLastCol = iCols1;
-
+                    m_iRows2PrintState = 0;
+                    m_iCols1PrintState = 0;
                 }
+
                 iLen += piSize[iCols1] + SIGN_LENGTH + SIZE_BETWEEN_TWO_VALUES;
             }
 
-            for(int iRows2 = 0 ; iRows2 < getRows() ; iRows2++)
+            for(int iRows2 = m_iRows2PrintState ; iRows2 < getRows() ; iRows2++)
             {
+                iCurrentLine++;
+                if((iMaxLines == 0 && iCurrentLine >= MAX_LINES) || (iMaxLines != 0 && iCurrentLine >= iMaxLines))
+                {
+                    if(m_iRows2PrintState == 0 && iLastCol != 0)
+                    {//add header
+                        ostr << std::endl << L"       column " << iLastCol + 1 << L" to " << getCols() << std::endl << std::endl;
+                    }
+
+                    ostr << ostemp.str();
+                    m_iRows2PrintState = iRows2;
+                    m_iCols1PrintState = iLastCol;
+                    return false;
+                }
+
                 for(int iCols2 = iLastCol ; iCols2 < getCols() ; iCols2++)
                 {
                     int iWidth  = 0;
@@ -213,16 +270,18 @@ namespace types
                     int iPos    = getIndex(_piDims);
 
                     addUnsignedIntValue(&ostemp, get(iPos), piSize[iCols2]);
-                    ostemp << SPACE_BETWEEN_TWO_VALUES;
                 }
                 ostemp << std::endl;
             }
-            if(iLastCol != 0)
+
+            if(m_iRows2PrintState == 0 && iLastCol != 0)
             {
                 ostr << std::endl << L"       column " << iLastCol + 1 << L" to " << getCols() << std::endl << std::endl;
             }
             ostr << ostemp.str();
         }
+
+        return true;
     }
 
     bool UInt16::operator==(const InternalType& it)
index c20e52a..c1436df 100644 (file)
@@ -84,11 +84,12 @@ namespace types
         std::cout << "types::UInt32";
     }
 
-    void UInt32::subMatrixToString(std::wostringstream& ostr, int* _piDims, int _iDims)
+    bool UInt32::subMatrixToString(std::wostringstream& ostr, int* _piDims, int _iDims)
     {
+        int iCurrentLine = 0;
         int iLineLen = getConsoleWidth();
-        ostr << std::endl;
-        /*Comment tenir compte de la longueur des lignes dans le formatage de variable ? */
+        int iMaxLines = getConsoleLines();
+
         if(isScalar())
         {//scalar
             int iWidth  = 0;
@@ -102,25 +103,42 @@ namespace types
         }
         else if(getCols() == 1)
         {//column vector
+            int iWidthMax = 0;
 
+            //Array with the max printed size of each col
             for(int i = 0 ; i < getRows() ; i++)
             {
-                int iWidth  = 0;
+                _piDims[1] = 0;
+                _piDims[0] = i;
+                int iWidth = 0;
+                int iPos = getIndex(_piDims);
+                getUnsignedIntFormat(get(iPos), &iWidth);
+                iWidthMax = Max(iWidthMax, iWidth);
+            }
+
+            for(int i = m_iRows1PrintState ; i < getRows() ; i++)
+            {
+                iCurrentLine++;
+                if((iMaxLines == 0 && iCurrentLine >= MAX_LINES) || (iMaxLines != 0 && iCurrentLine >= iMaxLines))
+                {
+                    m_iRows1PrintState = i;
+                    return false;
+                }
+
                 _piDims[1]  = 0;
                 _piDims[0]  = i;
                 int iPos    = getIndex(_piDims);
 
-                getUnsignedIntFormat(get(iPos), &iWidth);
-                addUnsignedIntValue(&ostr, get(iPos), iWidth);
+                addUnsignedIntValue(&ostr, get(iPos), iWidthMax);
                 ostr << std::endl;
             }
         }
         else if(getRows() == 1)
         {//row vector
             std::wostringstream ostemp;
-            int iLastVal = 0;
+            int iLastVal = m_iCols1PrintState;
 
-            for(int i = 0 ; i < getCols() ; i++)
+            for(int i = m_iCols1PrintState ; i < getCols() ; i++)
             {
                 int iWidth  = 0;
                 int iLen    = 0;
@@ -132,17 +150,19 @@ namespace types
                 iLen = iWidth + static_cast<int>(ostemp.str().size());
                 if(iLen > iLineLen)
                 {//Max length, new line
+                    iCurrentLine += 4; //"column x to Y" + empty line + value + empty line
+                    if((iMaxLines == 0 && iCurrentLine >= MAX_LINES) || (iMaxLines != 0 && iCurrentLine >= iMaxLines))
+                    {
+                        m_iCols1PrintState = iLastVal;
+                        return false;
+                    }
+
                     ostr << std::endl << L"       column " << iLastVal + 1 << L" to " << i << std::endl << std::endl;
                     ostr << ostemp.str() << std::endl;
                     ostemp.str(L"");
                     iLastVal = i;
                 }
 
-                if(ostemp.str().size() != 0)
-                {
-                    ostemp << SPACE_BETWEEN_TWO_VALUES;
-                }
-
                 addUnsignedIntValue(&ostemp, get(iPos), iWidth);
             }
 
@@ -157,14 +177,14 @@ namespace types
         {
             std::wostringstream ostemp;
             int iLen = 0;
-            int iLastCol = 0;
+            int iLastCol = m_iCols1PrintState;
 
             //Array with the max printed size of each col
             int *piSize = new int[getCols()];
             memset(piSize, 0x00, getCols() * sizeof(int));
 
             //compute the row size for padding for each printed bloc.
-            for(int iCols1 = 0 ; iCols1 < getCols() ; iCols1++)
+            for(int iCols1 = m_iCols1PrintState ; iCols1 < getCols() ; iCols1++)
             {
                 for(int iRows1 = 0 ; iRows1 < getRows() ; iRows1++)
                 {
@@ -179,8 +199,23 @@ namespace types
 
                 if(iLen + piSize[iCols1] > iLineLen)
                 {//find the limit, print this part
-                    for(int iRows2 = 0 ; iRows2 < getRows() ; iRows2++)
+                    for(int iRows2 = m_iRows2PrintState ; iRows2 < getRows() ; iRows2++)
                     {
+                        iCurrentLine++;
+                        if((iMaxLines == 0 && iCurrentLine >= MAX_LINES) ||
+                            ( (iMaxLines != 0 && iCurrentLine + 3 >= iMaxLines && iRows2 == m_iRows2PrintState) || 
+                            (iMaxLines != 0 && iCurrentLine + 1 >= iMaxLines && iRows2 != m_iRows2PrintState)))
+                        {
+                            if(m_iRows2PrintState == 0 && iRows2 != 0)
+                            {//add header
+                                ostr << std::endl << L"       column " << iLastCol + 1 << L" to " << iCols1 << std::endl << std::endl;
+                            }
+                            ostr << ostemp.str();
+                            m_iRows2PrintState = iRows2;
+                            m_iCols1PrintState = iLastCol;
+                            return false;
+                        }
+
                         for(int iCols2 = iLastCol ; iCols2 < iCols1 ; iCols2++)
                         {
                             int iWidth  = 0;
@@ -189,22 +224,44 @@ namespace types
                             int iPos    = getIndex(_piDims);
 
                             addUnsignedIntValue(&ostemp, get(iPos), piSize[iCols2]);
-                            ostemp << SPACE_BETWEEN_TWO_VALUES;
                         }
                         ostemp << std::endl;
                     }
                     iLen = 0;
-                    ostr << std::endl << L"       column " << iLastCol + 1 << L" to " << iCols1 << std::endl << std::endl;;
+
+                    iCurrentLine++;
+                    if(m_iRows2PrintState == 0)
+                    {
+                        iCurrentLine += 3;
+                        ostr << std::endl << L"       column " << iLastCol + 1 << L" to " << iCols1 << std::endl << std::endl;
+                    }
+                    
                     ostr << ostemp.str();
                     ostemp.str(L"");
                     iLastCol = iCols1;
-
+                    m_iRows2PrintState = 0;
+                    m_iCols1PrintState = 0;
                 }
+
                 iLen += piSize[iCols1] + SIGN_LENGTH + SIZE_BETWEEN_TWO_VALUES;
             }
 
-            for(int iRows2 = 0 ; iRows2 < getRows() ; iRows2++)
+            for(int iRows2 = m_iRows2PrintState ; iRows2 < getRows() ; iRows2++)
             {
+                iCurrentLine++;
+                if((iMaxLines == 0 && iCurrentLine >= MAX_LINES) || (iMaxLines != 0 && iCurrentLine >= iMaxLines))
+                {
+                    if(m_iRows2PrintState == 0 && iLastCol != 0)
+                    {//add header
+                        ostr << std::endl << L"       column " << iLastCol + 1 << L" to " << getCols() << std::endl << std::endl;
+                    }
+
+                    ostr << ostemp.str();
+                    m_iRows2PrintState = iRows2;
+                    m_iCols1PrintState = iLastCol;
+                    return false;
+                }
+
                 for(int iCols2 = iLastCol ; iCols2 < getCols() ; iCols2++)
                 {
                     int iWidth  = 0;
@@ -213,16 +270,18 @@ namespace types
                     int iPos    = getIndex(_piDims);
 
                     addUnsignedIntValue(&ostemp, get(iPos), piSize[iCols2]);
-                    ostemp << SPACE_BETWEEN_TWO_VALUES;
                 }
                 ostemp << std::endl;
             }
-            if(iLastCol != 0)
+
+            if(m_iRows2PrintState == 0 && iLastCol != 0)
             {
                 ostr << std::endl << L"       column " << iLastCol + 1 << L" to " << getCols() << std::endl << std::endl;
             }
             ostr << ostemp.str();
         }
+
+        return true;
     }
 
     bool UInt32::operator==(const InternalType& it)
index f9704f5..ed14c49 100644 (file)
@@ -84,11 +84,12 @@ namespace types
         std::cout << "types::UInt64";
     }
 
-    void UInt64::subMatrixToString(std::wostringstream& ostr, int* _piDims, int _iDims)
+    bool UInt64::subMatrixToString(std::wostringstream& ostr, int* _piDims, int _iDims)
     {
+        int iCurrentLine = 0;
         int iLineLen = getConsoleWidth();
-        ostr << std::endl;
-        /*Comment tenir compte de la longueur des lignes dans le formatage de variable ? */
+        int iMaxLines = getConsoleLines();
+
         if(isScalar())
         {//scalar
             int iWidth  = 0;
@@ -102,25 +103,42 @@ namespace types
         }
         else if(getCols() == 1)
         {//column vector
+            int iWidthMax = 0;
 
+            //Array with the max printed size of each col
             for(int i = 0 ; i < getRows() ; i++)
             {
-                int iWidth  = 0;
+                _piDims[1] = 0;
+                _piDims[0] = i;
+                int iWidth = 0;
+                int iPos = getIndex(_piDims);
+                getUnsignedIntFormat(get(iPos), &iWidth);
+                iWidthMax = Max(iWidthMax, iWidth);
+            }
+
+            for(int i = m_iRows1PrintState ; i < getRows() ; i++)
+            {
+                iCurrentLine++;
+                if((iMaxLines == 0 && iCurrentLine >= MAX_LINES) || (iMaxLines != 0 && iCurrentLine >= iMaxLines))
+                {
+                    m_iRows1PrintState = i;
+                    return false;
+                }
+
                 _piDims[1]  = 0;
                 _piDims[0]  = i;
                 int iPos    = getIndex(_piDims);
 
-                getUnsignedIntFormat(get(iPos), &iWidth);
-                addUnsignedIntValue(&ostr, get(iPos), iWidth);
+                addUnsignedIntValue(&ostr, get(iPos), iWidthMax);
                 ostr << std::endl;
             }
         }
         else if(getRows() == 1)
         {//row vector
             std::wostringstream ostemp;
-            int iLastVal = 0;
+            int iLastVal = m_iCols1PrintState;
 
-            for(int i = 0 ; i < getCols() ; i++)
+            for(int i = m_iCols1PrintState ; i < getCols() ; i++)
             {
                 int iWidth  = 0;
                 int iLen    = 0;
@@ -132,17 +150,19 @@ namespace types
                 iLen = iWidth + static_cast<int>(ostemp.str().size());
                 if(iLen > iLineLen)
                 {//Max length, new line
+                    iCurrentLine += 4; //"column x to Y" + empty line + value + empty line
+                    if((iMaxLines == 0 && iCurrentLine >= MAX_LINES) || (iMaxLines != 0 && iCurrentLine >= iMaxLines))
+                    {
+                        m_iCols1PrintState = iLastVal;
+                        return false;
+                    }
+
                     ostr << std::endl << L"       column " << iLastVal + 1 << L" to " << i << std::endl << std::endl;
                     ostr << ostemp.str() << std::endl;
                     ostemp.str(L"");
                     iLastVal = i;
                 }
 
-                if(ostemp.str().size() != 0)
-                {
-                    ostemp << SPACE_BETWEEN_TWO_VALUES;
-                }
-
                 addUnsignedIntValue(&ostemp, get(iPos), iWidth);
             }
 
@@ -157,14 +177,14 @@ namespace types
         {
             std::wostringstream ostemp;
             int iLen = 0;
-            int iLastCol = 0;
+            int iLastCol = m_iCols1PrintState;
 
             //Array with the max printed size of each col
             int *piSize = new int[getCols()];
             memset(piSize, 0x00, getCols() * sizeof(int));
 
             //compute the row size for padding for each printed bloc.
-            for(int iCols1 = 0 ; iCols1 < getCols() ; iCols1++)
+            for(int iCols1 = m_iCols1PrintState ; iCols1 < getCols() ; iCols1++)
             {
                 for(int iRows1 = 0 ; iRows1 < getRows() ; iRows1++)
                 {
@@ -179,8 +199,23 @@ namespace types
 
                 if(iLen + piSize[iCols1] > iLineLen)
                 {//find the limit, print this part
-                    for(int iRows2 = 0 ; iRows2 < getRows() ; iRows2++)
+                    for(int iRows2 = m_iRows2PrintState ; iRows2 < getRows() ; iRows2++)
                     {
+                        iCurrentLine++;
+                        if((iMaxLines == 0 && iCurrentLine >= MAX_LINES) ||
+                            ( (iMaxLines != 0 && iCurrentLine + 3 >= iMaxLines && iRows2 == m_iRows2PrintState) || 
+                            (iMaxLines != 0 && iCurrentLine + 1 >= iMaxLines && iRows2 != m_iRows2PrintState)))
+                        {
+                            if(m_iRows2PrintState == 0 && iRows2 != 0)
+                            {//add header
+                                ostr << std::endl << L"       column " << iLastCol + 1 << L" to " << iCols1 << std::endl << std::endl;
+                            }
+                            ostr << ostemp.str();
+                            m_iRows2PrintState = iRows2;
+                            m_iCols1PrintState = iLastCol;
+                            return false;
+                        }
+
                         for(int iCols2 = iLastCol ; iCols2 < iCols1 ; iCols2++)
                         {
                             int iWidth  = 0;
@@ -189,22 +224,44 @@ namespace types
                             int iPos    = getIndex(_piDims);
 
                             addUnsignedIntValue(&ostemp, get(iPos), piSize[iCols2]);
-                            ostemp << SPACE_BETWEEN_TWO_VALUES;
                         }
                         ostemp << std::endl;
                     }
                     iLen = 0;
-                    ostr << std::endl << L"       column " << iLastCol + 1 << L" to " << iCols1 << std::endl << std::endl;;
+
+                    iCurrentLine++;
+                    if(m_iRows2PrintState == 0)
+                    {
+                        iCurrentLine += 3;
+                        ostr << std::endl << L"       column " << iLastCol + 1 << L" to " << iCols1 << std::endl << std::endl;
+                    }
+                    
                     ostr << ostemp.str();
                     ostemp.str(L"");
                     iLastCol = iCols1;
-
+                    m_iRows2PrintState = 0;
+                    m_iCols1PrintState = 0;
                 }
+
                 iLen += piSize[iCols1] + SIGN_LENGTH + SIZE_BETWEEN_TWO_VALUES;
             }
 
-            for(int iRows2 = 0 ; iRows2 < getRows() ; iRows2++)
+            for(int iRows2 = m_iRows2PrintState ; iRows2 < getRows() ; iRows2++)
             {
+                iCurrentLine++;
+                if((iMaxLines == 0 && iCurrentLine >= MAX_LINES) || (iMaxLines != 0 && iCurrentLine >= iMaxLines))
+                {
+                    if(m_iRows2PrintState == 0 && iLastCol != 0)
+                    {//add header
+                        ostr << std::endl << L"       column " << iLastCol + 1 << L" to " << getCols() << std::endl << std::endl;
+                    }
+
+                    ostr << ostemp.str();
+                    m_iRows2PrintState = iRows2;
+                    m_iCols1PrintState = iLastCol;
+                    return false;
+                }
+
                 for(int iCols2 = iLastCol ; iCols2 < getCols() ; iCols2++)
                 {
                     int iWidth  = 0;
@@ -213,16 +270,18 @@ namespace types
                     int iPos    = getIndex(_piDims);
 
                     addUnsignedIntValue(&ostemp, get(iPos), piSize[iCols2]);
-                    ostemp << SPACE_BETWEEN_TWO_VALUES;
                 }
                 ostemp << std::endl;
             }
-            if(iLastCol != 0)
+
+            if(m_iRows2PrintState == 0 && iLastCol != 0)
             {
                 ostr << std::endl << L"       column " << iLastCol + 1 << L" to " << getCols() << std::endl << std::endl;
             }
             ostr << ostemp.str();
         }
+
+        return true;
     }
 
     bool UInt64::operator==(const InternalType& it)
index 01a2497..77e2230 100644 (file)
@@ -84,11 +84,12 @@ namespace types
         std::cout << "types::UInt8";
     }
 
-    void UInt8::subMatrixToString(std::wostringstream& ostr, int* _piDims, int _iDims)
+    bool UInt8::subMatrixToString(std::wostringstream& ostr, int* _piDims, int _iDims)
     {
+        int iCurrentLine = 0;
         int iLineLen = getConsoleWidth();
-        ostr << std::endl;
-        /*Comment tenir compte de la longueur des lignes dans le formatage de variable ? */
+        int iMaxLines = getConsoleLines();
+
         if(isScalar())
         {//scalar
             int iWidth  = 0;
@@ -102,25 +103,42 @@ namespace types
         }
         else if(getCols() == 1)
         {//column vector
+            int iWidthMax = 0;
 
+            //Array with the max printed size of each col
             for(int i = 0 ; i < getRows() ; i++)
             {
-                int iWidth  = 0;
+                _piDims[1] = 0;
+                _piDims[0] = i;
+                int iWidth = 0;
+                int iPos = getIndex(_piDims);
+                getUnsignedIntFormat(get(iPos), &iWidth);
+                iWidthMax = Max(iWidthMax, iWidth);
+            }
+
+            for(int i = m_iRows1PrintState ; i < getRows() ; i++)
+            {
+                iCurrentLine++;
+                if((iMaxLines == 0 && iCurrentLine >= MAX_LINES) || (iMaxLines != 0 && iCurrentLine >= iMaxLines))
+                {
+                    m_iRows1PrintState = i;
+                    return false;
+                }
+
                 _piDims[1]  = 0;
                 _piDims[0]  = i;
                 int iPos    = getIndex(_piDims);
 
-                getUnsignedIntFormat(get(iPos), &iWidth);
-                addUnsignedIntValue(&ostr, get(iPos), iWidth);
+                addUnsignedIntValue(&ostr, get(iPos), iWidthMax);
                 ostr << std::endl;
             }
         }
         else if(getRows() == 1)
         {//row vector
             std::wostringstream ostemp;
-            int iLastVal = 0;
+            int iLastVal = m_iCols1PrintState;
 
-            for(int i = 0 ; i < getCols() ; i++)
+            for(int i = m_iCols1PrintState ; i < getCols() ; i++)
             {
                 int iWidth  = 0;
                 int iLen    = 0;
@@ -132,17 +150,19 @@ namespace types
                 iLen = iWidth + static_cast<int>(ostemp.str().size());
                 if(iLen > iLineLen)
                 {//Max length, new line
+                    iCurrentLine += 4; //"column x to Y" + empty line + value + empty line
+                    if((iMaxLines == 0 && iCurrentLine >= MAX_LINES) || (iMaxLines != 0 && iCurrentLine >= iMaxLines))
+                    {
+                        m_iCols1PrintState = iLastVal;
+                        return false;
+                    }
+
                     ostr << std::endl << L"       column " << iLastVal + 1 << L" to " << i << std::endl << std::endl;
                     ostr << ostemp.str() << std::endl;
                     ostemp.str(L"");
                     iLastVal = i;
                 }
 
-                if(ostemp.str().size() != 0)
-                {
-                    ostemp << SPACE_BETWEEN_TWO_VALUES;
-                }
-
                 addUnsignedIntValue(&ostemp, get(iPos), iWidth);
             }
 
@@ -157,14 +177,14 @@ namespace types
         {
             std::wostringstream ostemp;
             int iLen = 0;
-            int iLastCol = 0;
+            int iLastCol = m_iCols1PrintState;
 
             //Array with the max printed size of each col
             int *piSize = new int[getCols()];
             memset(piSize, 0x00, getCols() * sizeof(int));
 
             //compute the row size for padding for each printed bloc.
-            for(int iCols1 = 0 ; iCols1 < getCols() ; iCols1++)
+            for(int iCols1 = m_iCols1PrintState ; iCols1 < getCols() ; iCols1++)
             {
                 for(int iRows1 = 0 ; iRows1 < getRows() ; iRows1++)
                 {
@@ -179,8 +199,23 @@ namespace types
 
                 if(iLen + piSize[iCols1] > iLineLen)
                 {//find the limit, print this part
-                    for(int iRows2 = 0 ; iRows2 < getRows() ; iRows2++)
+                    for(int iRows2 = m_iRows2PrintState ; iRows2 < getRows() ; iRows2++)
                     {
+                        iCurrentLine++;
+                        if((iMaxLines == 0 && iCurrentLine >= MAX_LINES) ||
+                            ( (iMaxLines != 0 && iCurrentLine + 3 >= iMaxLines && iRows2 == m_iRows2PrintState) || 
+                            (iMaxLines != 0 && iCurrentLine + 1 >= iMaxLines && iRows2 != m_iRows2PrintState)))
+                        {
+                            if(m_iRows2PrintState == 0 && iRows2 != 0)
+                            {//add header
+                                ostr << std::endl << L"       column " << iLastCol + 1 << L" to " << iCols1 << std::endl << std::endl;
+                            }
+                            ostr << ostemp.str();
+                            m_iRows2PrintState = iRows2;
+                            m_iCols1PrintState = iLastCol;
+                            return false;
+                        }
+
                         for(int iCols2 = iLastCol ; iCols2 < iCols1 ; iCols2++)
                         {
                             int iWidth  = 0;
@@ -189,22 +224,44 @@ namespace types
                             int iPos    = getIndex(_piDims);
 
                             addUnsignedIntValue(&ostemp, get(iPos), piSize[iCols2]);
-                            ostemp << SPACE_BETWEEN_TWO_VALUES;
                         }
                         ostemp << std::endl;
                     }
                     iLen = 0;
-                    ostr << std::endl << L"       column " << iLastCol + 1 << L" to " << iCols1 << std::endl << std::endl;;
+
+                    iCurrentLine++;
+                    if(m_iRows2PrintState == 0)
+                    {
+                        iCurrentLine += 3;
+                        ostr << std::endl << L"       column " << iLastCol + 1 << L" to " << iCols1 << std::endl << std::endl;
+                    }
+                    
                     ostr << ostemp.str();
                     ostemp.str(L"");
                     iLastCol = iCols1;
-
+                    m_iRows2PrintState = 0;
+                    m_iCols1PrintState = 0;
                 }
+
                 iLen += piSize[iCols1] + SIGN_LENGTH + SIZE_BETWEEN_TWO_VALUES;
             }
 
-            for(int iRows2 = 0 ; iRows2 < getRows() ; iRows2++)
+            for(int iRows2 = m_iRows2PrintState ; iRows2 < getRows() ; iRows2++)
             {
+                iCurrentLine++;
+                if((iMaxLines == 0 && iCurrentLine >= MAX_LINES) || (iMaxLines != 0 && iCurrentLine >= iMaxLines))
+                {
+                    if(m_iRows2PrintState == 0 && iLastCol != 0)
+                    {//add header
+                        ostr << std::endl << L"       column " << iLastCol + 1 << L" to " << getCols() << std::endl << std::endl;
+                    }
+
+                    ostr << ostemp.str();
+                    m_iRows2PrintState = iRows2;
+                    m_iCols1PrintState = iLastCol;
+                    return false;
+                }
+
                 for(int iCols2 = iLastCol ; iCols2 < getCols() ; iCols2++)
                 {
                     int iWidth  = 0;
@@ -213,16 +270,18 @@ namespace types
                     int iPos    = getIndex(_piDims);
 
                     addUnsignedIntValue(&ostemp, get(iPos), piSize[iCols2]);
-                    ostemp << SPACE_BETWEEN_TWO_VALUES;
                 }
                 ostemp << std::endl;
             }
-            if(iLastCol != 0)
+
+            if(m_iRows2PrintState == 0 && iLastCol != 0)
             {
                 ostr << std::endl << L"       column " << iLastCol + 1 << L" to " << getCols() << std::endl << std::endl;
             }
             ostr << ostemp.str();
         }
+
+        return true;
     }
 
     bool UInt8::operator==(const InternalType& it)
index b77982e..4e32c1e 100644 (file)
@@ -5,3 +5,4 @@ EXPORTS
 getConsoleWidth
 getFormatSize
 getFormatMode
+getConsoleLines