Changeset 136


Ignore:
Timestamp:
Jan 9, 2006, 6:55:56 PM (18 years ago)
Author:
arnault
Message:

Implement ticket #14 - See CL 292

Location:
CMT/HEAD
Files:
6 edited

Legend:

Unmodified
Added
Removed
  • CMT/HEAD/ChangeLog

    r135 r136  
     12006-01-09    <arnault@lal.in2p3.fr> 292
     2
     3        * source/cmt_project.cxx (create_project): Access CMTPROJECTPATH through
     4        symbol or getenv
     5
     6        * source/cmt_symbol.cxx (get_env_value): Make use of the global
     7        display inhibitor to ensure that temporary value builder will not
     8        show unexpected output.
     9
     10        * source/cmt_symbol.h (class Symbol): Define a special accessor function for
     11        retrieving the value a symbols associated with an env. var. (typically
     12        for CMTPATH like variables)
     13
     14        * source/cmt_symbol.cxx (action): Trigger the Cmt::configure_cmt_path
     15        from CMTPROJECTPATH like CMTPATH
     16
    1172005-10-31  Christian Arnault  <arnault@lal.in2p3.fr> 291
    218
  • CMT/HEAD/mgr/cmt.nmake

    r113 r136  
    33#  Application cmt
    44#
    5 #   Generated Sun Oct 30 10:05:41 2005  by ARNAULT
     5#   Generated Mon Jan 09 18:51:50 2006  by ARNAULT
    66#
    77#====================================
  • CMT/HEAD/source/cmt_parser.cxx

    r109 r136  
    559559  cmt_string s;
    560560
     561  /*
    561562  Symbol* symbol = Symbol::find ("CMTPATH");
    562563  if (symbol != 0)
     
    583584      s = CmtSystem::getenv ("CMTPATH");
    584585    }
     586  */
     587
     588  s = Symbol::get_env_value ("CMTPATH");
    585589
    586590  {
  • CMT/HEAD/source/cmt_project.cxx

    r100 r136  
    204204  sep = CmtSystem::path_separator ();
    205205
    206   cmt_string cmtprojectpath = CmtSystem::getenv ("CMTPROJECTPATH");
     206  cmt_string cmtprojectpath = Symbol::get_env_value ("CMTPROJECTPATH");
    207207  CmtSystem::cmt_string_vector items;
    208208  CmtSystem::split (cmtprojectpath, sep, items);
     
    14271427  //   +             the new project is then parsed ... etc...
    14281428
    1429   cmt_string cmtprojectpath = CmtSystem::getenv ("CMTPROJECTPATH");
     1429  cmt_string cmtprojectpath = Symbol::get_env_value ("CMTPROJECTPATH");
     1430
    14301431  cmt_string sep;
    14311432  sep = CmtSystem::path_separator ();
  • CMT/HEAD/source/cmt_symbol.cxx

    r113 r136  
    1414#include "cmt_system.h"
    1515#include "cmt_database.h"
     16
     17// Global inhibitor of any display
     18bool Symbol::m_inhibit_display = false;
    1619
    1720//-------------------------------------------------------------
     
    981984      if (Cmt::get_current_access () == UserMode)
    982985        {
     986          /*
     987            The following statements mean that some symbols are
     988            always private.
     989            This list is hardcoded. This should be replaced by a
     990            database of "private" symbols.
     991           */
    983992          if (name == "constituents") return;
    984993          if (name == "constituentscclean") return;
     
    10281037
    10291038      if (name == "CMTPATH")
     1039        {
     1040          Cmt::configure_cmt_path (use);
     1041        }
     1042      else if (name == "CMTPROJECTPATH")
    10301043        {
    10311044          Cmt::configure_cmt_path (use);
     
    19421955      SymbolValue& value = value_list.values[selected];
    19431956
    1944       if (show_it)
     1957      if (show_it && !Symbol::get_inhibit_display())
    19451958        {
    19461959          value_list.show (symbol, value, first_definition);
     
    21482161      SymbolValue& value = value_list.values[selected];
    21492162         
    2150       if (show_it)
     2163      if (show_it && !Symbol::get_inhibit_display())
    21512164        {
    21522165          value_list.show (symbol, value, first_definition);
     
    24992512      SymbolValue& value = value_list.values[selected];
    25002513
    2501       if (show_it)
     2514      if (show_it && !Symbol::get_inhibit_display())
    25022515        {
    25032516          value_list.show (symbol, value, first_definition);
     
    25312544      SymbolValue& value = value_list.values[selected];
    25322545
    2533       if (show_it)
     2546      if (show_it && !Symbol::get_inhibit_display())
    25342547        {
    25352548          value_list.show (symbol, value, first_definition);
     
    25922605      SymbolValue& value = value_list.values[selected];
    25932606
    2594       if (show_it)
     2607      if (show_it && !Symbol::get_inhibit_display())
    25952608        {
    25962609          value_list.show (symbol, value, first_definition);
     
    26202633      SymbolValue& value = value_list.values[selected];
    26212634
    2622       if (show_it)
     2635      if (show_it && !Symbol::get_inhibit_display())
    26232636        {
    26242637          value_list.show (symbol, value, first_definition);
     
    27452758      SymbolValue& value = value_list.values[selected];
    27462759
    2747       if (show_it)
     2760      if (show_it && !Symbol::get_inhibit_display())
    27482761        {
    27492762          value_list.show (symbol, value, first_definition);
     
    30113024}
    30123025
     3026//-------------------------------------------------------------
     3027cmt_string Symbol::get_env_value (const cmt_string& name)
     3028{
     3029  cmt_string s;
     3030
     3031  Symbol* symbol = Symbol::find (name);
     3032  if (symbol != 0)
     3033    {
     3034      m_inhibit_display = true;
     3035
     3036      s = symbol->build_macro_value ();
     3037      Symbol::expand (s);
     3038
     3039      m_inhibit_display = false;
     3040    }
     3041  else
     3042    {
     3043      s = CmtSystem::getenv (name);
     3044    }
     3045
     3046  return (s);
     3047}
     3048
     3049bool Symbol::get_inhibit_display ()
     3050{
     3051  return (m_inhibit_display);
     3052}
     3053
  • CMT/HEAD/source/cmt_symbol.h

    r102 r136  
    101101  static bool check_tag_used (Tag* tag);
    102102
     103  static cmt_string get_env_value (const cmt_string& name);
     104
     105  static bool get_inhibit_display ();
     106
    103107public:
    104108  Symbol ();
     
    126130
    127131  int selected_value;        /* according to the last selected tag */
     132
     133private:
     134
     135  static bool m_inhibit_display;  // Global inhibitor of any display
     136
    128137};
    129138
Note: See TracChangeset for help on using the changeset viewer.