Changeset 1091


Ignore:
Timestamp:
04/12/17 19:05:14 (5 years ago)
Author:
ymipsl
Message:

Enhancement : in file attribut ts_prefix, the substring "%file_name%", if found, is replaced by the file name.
(untested for now)

YM

File:
1 edited

Legend:

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

    r1041 r1091  
    10181018       if (!file->timeseries.isEmpty() && file->timeseries != CFile::timeseries_attr::none) 
    10191019       { 
    1020          StdString tsPrefix = !file->ts_prefix.isEmpty() ? file->ts_prefix : file->getFileOutputName(); 
    1021  
     1020         StdString fileNameStr("%file_name%") ; 
     1021         StdString tsPrefix = !file->ts_prefix.isEmpty() ? file->ts_prefix : fileNameStr ; 
     1022          
     1023         StdString fileName=file->getFileOutputName(); 
     1024         size_t pos=tsPrefix.find(fileNameStr) ; 
     1025         while (pos!=std::string::npos) 
     1026         { 
     1027           tsPrefix=tsPrefix.replace(pos,fileNameStr.size(),fileName) ; 
     1028           pos=tsPrefix.find(fileNameStr) ; 
     1029         } 
     1030         
    10221031         const std::vector<CField*> allFields = file->getAllFields(); 
    10231032         for (size_t j = 0; j < allFields.size(); j++) 
     
    10341043               tsFile->getVirtualVariableGroup()->addChild(fileVars[k]); 
    10351044 
     1045             
    10361046             tsFile->name = tsPrefix + "_"; 
    10371047             if (!field->name.isEmpty()) 
Note: See TracChangeset for help on using the changeset viewer.