Index: trunk/SophyaPI/PIext/cxxexecutor.cc
===================================================================
--- trunk/SophyaPI/PIext/cxxexecutor.cc	(revision 1229)
+++ trunk/SophyaPI/PIext/cxxexecutor.cc	(revision 1230)
@@ -8,4 +8,6 @@
 #include "pistdimgapp.h"
 
+
+void FillVStringFrString(string s,vector<string>& vs,char sep = ' ');
 
 
@@ -36,5 +38,7 @@
 kw = "c++args";
 usage = "c++args: Define user function arguments\n";
-usage+= "Usage: c++args arg1 arg2 arg3 ...";
+usage+= "Usage: c++args arg1 arg2 arg3 ...\n";
+usage+= "       c++args -? : give current arguments\n";
+usage+= "       c++args    : reset current arguments";
 mpiac->RegisterCommand(kw, usage, this, hgrp);
 
@@ -65,4 +69,6 @@
 usage = "c++include: give personnal includes to be used\n";
 usage+= "Usage: c++include myinc1.h myinc2.h ...\n";
+usage+= "       c++include -? : give current include files\n";
+usage+= "       c++include    : reset current include files\n";
 usage+= "Warning: to be used before c++create... c++exec...";
 mpiac->RegisterCommand(kw, usage, this, hgrp);
@@ -71,4 +77,6 @@
 usage = "c++compileopt: give additionnal compile options\n";
 usage+= "Usage: c++compileopt -g -O5 -IMy_Inc_Dir ...\n";
+usage+= "       c++compileopt -? : give current compile options\n";
+usage+= "       c++compileopt    : reset current compile options\n";
 usage+= "Warning: to be used before c++compile";
 mpiac->RegisterCommand(kw, usage, this, hgrp);
@@ -76,5 +84,7 @@
 kw = "c++linkopt";
 usage = "c++linkopt: give additionnal link options\n";
-usage+= "Usage: c++linkopt -g -O5 ...";
+usage+= "Usage: c++linkopt -g -O5 ...\n";
+usage+= "       c++linkopt -? : give current link options\n";
+usage+= "       c++linkopt    : reset current link options\n";
 usage+= "Warning: to be used before c++compile";
 mpiac->RegisterCommand(kw, usage, this, hgrp);
@@ -82,7 +92,11 @@
 kw = "c++mylibs";
 usage = "c++mylibs: give additionnal libraries\n";
-usage+= "Usage: c++mylibs -LMy_Lib_Dir -lmylib1 -lmylib2 ...";
+usage+= "Usage: c++mylibs -LMy_Lib_Dir -lmylib1 -lmylib2 ...\n";
+usage+= "       c++mylibs -? : give current additionnal libraries\n";
+usage+= "       c++mylibs    : reset current additionnal libraries\n";
 usage+= "Warning: to be used before c++compile";
 mpiac->RegisterCommand(kw, usage, this, hgrp);
+
+
 
 kw = "c++setvar";
@@ -127,7 +141,6 @@
 
 } else if(kw == "c++args") {
-  mCallArgs.resize(0);
-  if(tokens.size()>=1)
-    for(uint_4 i=0;i<tokens.size();i++) mCallArgs.push_back(tokens[i]);
+  if(tokens.size()==1) if(tokens[0]=="-?") cout<<"c++args "<<GetArgs()<<endl;
+  FillArgs(tokens);
 
 } else if(kw == "c++create") {
@@ -159,29 +172,24 @@
 
 } else if(kw == "c++include") {
-  mIncList.resize(0);
-  if(tokens.size()>=1)
-    for(uint_4 i=0;i<tokens.size();i++) mIncList.push_back(tokens[i]);
+  if(tokens.size()==1) if(tokens[0]=="-?") cout<<"c++include "<<GetInclude()<<endl;
+  FillInclude(tokens);
 
 } else if(kw == "c++compileopt") {
-  mCompOpt = "";
-  if(tokens.size()>=1) {
-    for(uint_4 i=0;i<tokens.size();i++) mCompOpt += tokens[i] + " ";
-  }
+  if(tokens.size()==1) if(tokens[0]=="-?") cout<<"c++compileopt "<<GetCompileOpt()<<endl;
+  FillCompileOpt(tokens);
 
 } else if(kw == "c++linkopt") {
-  mLinkOpt = "";
-  if(tokens.size()>=1) {
-    for(uint_4 i=0;i<tokens.size();i++) mLinkOpt += tokens[i] + " ";
-  }
+  if(tokens.size()==1) if(tokens[0]=="-?") cout<<"c++linkopt "<<GetLinkOpt()<<endl;
+  FillLinkOpt(tokens);
 
 } else if(kw == "c++mylibs") {
-  mMyLibs = "";
-  if(tokens.size()>=1) {
-    for(uint_4 i=0;i<tokens.size();i++) mMyLibs += tokens[i] + " ";
-  }
+  if(tokens.size()==1) if(tokens[0]=="-?") cout<<"c++mylibs "<<GetLinkLibs()<<endl;
+  FillLinkLibs(tokens);
+
+
 
 } else if(kw == "c++setvar") {
   if(tokens.size()<2) {
-    cerr << " Usage: c++setvar varname varcontent " << endl;
+    cout<<" Usage: c++setvar varname varcontent "<<endl;
     return(1);
   }
@@ -193,12 +201,12 @@
 } else if(kw == "c++getvar") {
   if(tokens.size()<1) {
-    cerr << " Usage: c++getvar varname " << endl;
+    cout<<" Usage: c++getvar varname "<<endl;
     return(1);
   }
   NamedObjMgr omg;
-  cout << "c++getvar(" << tokens[0] << ")=" << omg.GetVar(tokens[0]) << endl;
+  cout<<"c++getvar("<<tokens[0]<<")="<<omg.GetVar(tokens[0])<<endl;
 }  else if(kw == "c++varlist") {
   NamedObjMgr omg; 
-  cout << omg.GetVarList();
+  cout<<omg.GetVarList();
 }
 
@@ -403,5 +411,5 @@
 }
 
-cout<<"User code filled from file"<<filename<<endl;
+cout<<"User code filled from file "<<filename<<endl;
 return 0;
 }
@@ -492,4 +500,105 @@
 return 0;
 }
+
+/* --Methode-- */
+void CxxExecutor::FillArgs(vector<string>& args)
+{
+mCallArgs.resize(0);
+if(args.size()<1) return;
+for(uint_4 i=0;i<args.size();i++) mCallArgs.push_back(args[i]);
+}
+
+void CxxExecutor::FillArgs(string& args)
+{
+mCallArgs.resize(0);
+FillVStringFrString(args,mCallArgs,' ');
+}
+
+string CxxExecutor::GetArgs(void)
+{
+string dum = "";
+if(mCallArgs.size()<1) return dum;
+for(uint_4 i=0;i<mCallArgs.size();i++) dum += mCallArgs[i] + " ";
+return dum;
+}
+
+/* --Methode-- */
+void CxxExecutor::FillInclude(vector<string>& inc)
+{
+mIncList.resize(0);
+if(inc.size()<1) return;
+for(uint_4 i=0;i<inc.size();i++) mIncList.push_back(inc[i]);
+}
+
+void CxxExecutor::FillInclude(string& inc)
+{
+mIncList.resize(0);
+FillVStringFrString(inc,mIncList,' ');
+}
+
+string CxxExecutor::GetInclude(void)
+{
+string dum = "";
+if(mIncList.size()<1) return dum;
+for(uint_4 i=0;i<mIncList.size();i++) dum += mIncList[i] + " ";
+return dum;
+}
+
+/* --Methode-- */
+void CxxExecutor::FillCompileOpt(vector<string>& copt)
+{
+mCompOpt = "";
+if(copt.size()<1) return;
+for(uint_4 i=0;i<copt.size();i++) mCompOpt += copt[i] + " ";
+}
+
+void CxxExecutor::FillCompileOpt(string& copt)
+{
+mCompOpt = copt;
+}
+
+string CxxExecutor::GetCompileOpt(void)
+{
+return mCompOpt;
+}
+
+/* --Methode-- */
+void CxxExecutor::FillLinkOpt(vector<string>& lopt)
+{
+mLinkOpt = "";
+if(lopt.size()<1) return;
+for(uint_4 i=0;i<lopt.size();i++) mLinkOpt += lopt[i] + " ";
+}
+
+void CxxExecutor::FillLinkOpt(string& lopt)
+{
+mLinkOpt = lopt;
+}
+
+string CxxExecutor::GetLinkOpt(void)
+{
+return mLinkOpt;
+}
+
+/* --Methode-- */
+void CxxExecutor::FillLinkLibs(vector<string>& llibs)
+{
+mMyLibs = "";
+if(llibs.size()<1) return;
+for(uint_4 i=0;i<llibs.size();i++) mMyLibs += llibs[i] + " ";
+}
+
+void CxxExecutor::FillLinkLibs(string& llibs)
+{
+mMyLibs = llibs;
+}
+
+string CxxExecutor::GetLinkLibs(void)
+{
+return mMyLibs;
+}
+
+
+
 
 /* --Methode--  DO NOT DELETE.... cmv property !!!
@@ -547,2 +656,37 @@
 */
 
+
+void FillVStringFrString(string s,vector<string>& vs,char sep)
+// Use string "s" to fill vector of strings "vs"
+// considering char "sep" as a separator.
+// Vector is filled from its end (no reset done).
+// Tp write a "sep" char, use \'sep'
+// Warning: separator "sep" could not be set to '\'
+// Ex: sep=' ': s="aaa   bbb cc d " -> vs=(aaa,bbb,cc,d)
+// Ex: sep=';': s="aaa   ;bbb; cc;d " -> vs=(aaa   ,bbb, cc,d )
+// Ex: sep=';': s=";aaa\;bbb;;;ccc;ddd" -> vs=(aaa;bbb,ccc,ddd)
+// Ex: sep=';': s=";aaa\;bbb;;;ccc;ddd\" -> vs=(aaa;bbb,ccc,ddd\)
+{
+uint_4 ls = s.size();
+if(ls<=0 || sep=='\\') return;
+s += sep; // add a separator at the end
+const char* str = s.c_str();
+ls = strlen(str); // str[ls-1]==sep cf ci-dessus
+string dum = "";
+for(uint_4 i=0; i<ls; i++) {
+  if(i==0 && str[i]==sep) {
+    continue;
+  } else if(str[i]=='\\') {
+    if(str[i+1]!=sep || i==ls-2) dum += str[i];
+  } else if(str[i]!=sep) {
+    dum += str[i];
+  } else {  // C'est un "sep" mais est-ce vraiment un separateur?
+    if(str[i-1]=='\\' && i!=ls-1) dum += str[i];
+    else {  // C'est un separateur, ne delimite t-il pas d'autres separateurs?
+      if(dum.size()<=0) continue;
+      vs.push_back(dum);
+      dum = "";
+    }
+  }
+}
+}
Index: trunk/SophyaPI/PIext/cxxexecutor.h
===================================================================
--- trunk/SophyaPI/PIext/cxxexecutor.h	(revision 1229)
+++ trunk/SophyaPI/PIext/cxxexecutor.h	(revision 1230)
@@ -22,4 +22,5 @@
            CxxExecutor(PIACmd* piac, PIStdImgApp* app);
   virtual ~CxxExecutor();
+
   virtual int Execute(string& keyw,vector<string>& args);
 
@@ -33,16 +34,30 @@
   int  FillUserCode(vector<string>& usercode,uint_4 first);
   int  FillUserCode(string filename);
+
   int  Compile(string rootfilename="cxx_spiapp");
        int CrMakefile(void);
+
   int  Link(string libname="cxx_spiapp.so",string func="usercxx");
   int  Call(string func="usercxx");
-  //int  FillArgs(vector<string>& args);
-  //int  FillArgs(string& args);
-  //string GetArgs(void);
-  // etc...
-  //int  FillInclude(vector<string>& inc);
-  //int  FillCompileOpt(vector<string>& copt);
-  //int  FillLinkOpt(vector<string>& lopt);
-  //int  FillLinkLibs(vector<string>& llibs);
+
+  void   FillArgs(vector<string>& args);
+  void   FillArgs(string& args);
+  string GetArgs(void);
+
+  void   FillInclude(vector<string>& inc);
+  void   FillInclude(string& inc);
+  string GetInclude(void);
+
+  void   FillCompileOpt(vector<string>& copt);
+  void   FillCompileOpt(string& copt);
+  string GetCompileOpt(void);
+
+  void   FillLinkOpt(vector<string>& lopt);
+  void   FillLinkOpt(string& lopt);
+  string GetLinkOpt(void);
+
+  void   FillLinkLibs(vector<string>& llibs);
+  void   FillLinkLibs(string& llibs);
+  string GetLinkLibs(void);
 
 private:
@@ -55,4 +70,3 @@
 };
 
-
 #endif
