Changeset a110589 in tol


Ignore:
Timestamp:
Jun 24, 2010, 1:37:53 PM (16 years ago)
Author:
Víctor de Buen <vdebuen@…>
Branches:
1941-docker-image-to-test, devel, master
Children:
db38740
Parents:
dcc0498f
Message:

Refs #921
New method CheckNonDeclarativeAction

git-svn-id: ​https://www.tol-project.org/svn/tolp/trunk@2307 be4846ae-f051-483a-831f-b64e7d08527f

Location:
tol/bbasic
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • tol/bbasic/out.cpp

    rdcc0498f ra110589  
    3131#include <tol/tol_bdat.h>
    3232#include <tol/tol_boper.h>
     33#include <tol/tol_ois.h>
    3334
    3435//--------------------------------------------------------------------
    … …  
    538539}
    539540
    540 /*
    541 //--------------------------------------------------------------------
    542 BText BOut::GetStatus()
    543 //--------------------------------------------------------------------
    544 {
    545   BText vmode = "";
    546   if(ErrorTerm  ()) { vmode += "E"; }
    547   if(WarningTerm()) { vmode += "W"; }
    548   if(StdTerm    ()) { vmode += "S"; }
    549   if(InfoTerm   ()) { vmode += "U"; }
    550   if(TraceTerm  ()) { vmode += "T"; }
    551   if(vmode=="")     { vmode = "mA"; }
    552   else              { vmode = "v"+vmode; }
    553 }
    554  
    555 //--------------------------------------------------------------------
    556 bool BOut::SetStatusTerm()(const BText& vmode)
    557 //--------------------------------------------------------------------
    558 {
    559   bool ok = true;
    560   unsigned int i=0;
    561   if(!vmode.HasName()) { return; }
    562   if((vmode[0]!='v')&&(vmode[0]!='m'))
    563   {
    564     ok = false;
    565   }
    566   else if((vmode[0]=='v') && (vmode[1]=='\0'))
    567   {
    568   //Backward compatibility of non explicit verbose mode vmode=="v"
    569   //is equivalent to explicit verbose mode "vAmT", is to say, all
    570   //vervose but traces
    571     BOut::PutAllHci   (true);
    572     BOut::PutAllTerm  (true);
    573     BOut::PutTraceHci (false);
    574     BOut::PutTraceTerm(false);
    575   }
    576   else if((vmode[0]=='m') && (vmode[1]=='\0'))
    577   {
    578   //Backward compatibility of non explicit verbose mode vmode=="m"
    579   //is equivalent to explicit verbose mode "mAvE", is to say, all
    580   //mute but errors
    581     BOut::PutAllHci   (false);
    582     BOut::PutAllTerm  (false);
    583     BOut::PutErrorHci (true);
    584     BOut::PutErrorTerm(true);
    585   }
    586   else
    587   {
    588     bool mode;
    589   //If argument begis
    590     if(vmode[0]=='v')     
    591     {
    592       BOut::PutAllHci (false);
    593       BOut::PutAllTerm(false);
    594       mode = true;
    595     }
    596     else if(vmode[0]=='m')
    597     {
    598       BOut::PutAllHci (true);
    599       BOut::PutAllTerm(true);
    600       mode = false;
    601     }
    602     else                   
    603     {
    604       ok = false;
    605     }
    606     for(i=1; ok && vmode[i]; i++)
    607     {
    608       switch (vmode[i])
    609       {
    610         case 'A':
    611           BOut::PutAllHci (mode);
    612           BOut::PutAllTerm(mode);
    613           break;
    614         case 'E':
    615           BOut::PutErrorHci (mode);
    616           BOut::PutErrorTerm(mode);
    617           break;
    618         case 'W':
    619           BOut::PutWarningHci (mode);
    620           BOut::PutWarningTerm(mode);
    621           break;
    622         case 'S':
    623           BOut::PutStdHci (mode);
    624           BOut::PutStdTerm(mode);
    625           break;
    626         case 'U':
    627           BOut::PutInfoHci (mode);
    628           BOut::PutInfoTerm(mode);
    629           break;
    630         case 'T':
    631           BOut::PutTraceHci (mode);
    632           BOut::PutTraceTerm(mode);
    633           break;
    634         default :
    635           // invalid character
    636           ok = false;
    637           break;
    638       }
    639       if(!ok) { break; }
    640     }
    641   }
    642   if(!ok)
    643   {
    644     InitVerboseMode();
    645     Error(I2
    646     (
    647       "Wrong formatted verbose/mute argument\n"
    648       "Default values will be used.\n"
    649       "Unexpected character '",
    650       "Formato inválido del argumento verbose/mute\n"
    651       "Se usarán los valores por defecto.\n"
    652       "Caracter inesperado '"
    653     )+vmode[i]+"' "+I2
    654     (
    655       "at position",
    656       "en la posición"
    657     )+" "+int(i+1)+I2
    658     (
    659       " of argument ",
    660       " del argumento "
    661     )+vmode+"\n\n\n"+HelpVerboseMode());
    662   }
    663 }
    664 */
     541
     542//--------------------------------------------------------------------
     543  bool CheckNonDeclarativeAction(const BText& msg)
     544//--------------------------------------------------------------------
     545{
     546  if(!BOis::RunningUseModule()) { return(false); }
     547  Error(BText("OIS: ")+
     548   "Sorry, non declarative actions are forbidden while Ois.UseModule "
     549   "is running. Cannot use \n"+msg);
     550  return(true);
     551}
  • tol/bbasic/tol_bout.h

    rdcc0498f ra110589  
    208208  //! Sends an Info level message to available outputs
    209209  friend TOL_API void Info(const BText&);
    210 
     210  //! Sends an error message to all current available outputs
     211  //when it occurs a non declarative action while Ois.UseModule
     212  //is running
     213  friend TOL_API bool CheckNonDeclarativeAction(const BText&);
     214 
    211215  friend class TC_MsgMan;
    212216};
Note: See TracChangeset for help on using the changeset viewer.