Ignore:
Timestamp:
12/02/14 15:18:09 (9 years ago)
Author:
rlacroix
Message:

Convert some attributes to enumerations:

  • file: par_access
  • context: calendar_type

Those changes should have no effect on existing XML configuration files and ensure that a proper error message is always displayed during parsing if the value is not supported.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • XIOS/trunk/src/node/file.cpp

    r518 r526  
    358358         oss << ".nc"; 
    359359 
    360          if (isOpen) data_out->closeFile() ; 
    361          bool isCollective=true ; 
    362          if (!par_access.isEmpty()) 
    363          { 
    364            if (par_access.getValue()=="independent") isCollective=false ; 
    365            else if (par_access.getValue()=="collective") isCollective=true ; 
    366            else 
    367            { 
    368              ERROR("void Context::createDataOutput(void)", 
    369                         "incorrect file <par_access> attribut : must be <collective> or <indepedent>, " 
    370                         <<"having : <"<<type.getValue()<<">") ; 
    371            } 
    372          } 
     360         bool isCollective = par_access.isEmpty() ||  par_access == par_access_attr::collective; 
     361 
     362         if (isOpen) data_out->closeFile(); 
     363 
    373364         data_out=shared_ptr<CDataOutput>(new CNc4DataOutput(oss.str(), false, useClassicFormat, 
    374365                                                             fileComm, multifile, isCollective)); 
Note: See TracChangeset for help on using the changeset viewer.