Changeset 773 for XIOS/trunk/src/node


Ignore:
Timestamp:
10/30/15 16:33:49 (8 years ago)
Author:
rlacroix
Message:

File/Variable?: Add an helper function to get the output name.

Location:
XIOS/trunk/src/node
Files:
5 edited

Legend:

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

    r740 r773  
    921921       if (!file->timeseries.isEmpty() && file->timeseries != CFile::timeseries_attr::none) 
    922922       { 
    923          StdString tsPrefix = !file->ts_prefix.isEmpty() ? file->ts_prefix : (!file->name.isEmpty() ? file->name : file->getId()); 
     923         StdString tsPrefix = !file->ts_prefix.isEmpty() ? file->ts_prefix : file->getFileOutputName(); 
    924924 
    925925         const std::vector<CField*> allFields = file->getAllFields(); 
  • XIOS/trunk/src/node/file.cpp

    r771 r773  
    4747 
    4848   //---------------------------------------------------------------- 
     49 
     50   const StdString& CFile::getFileOutputName(void) const 
     51   { 
     52     return name.isEmpty() ? getId() : name; 
     53   } 
     54 
     55   //---------------------------------------------------------------- 
    4956   /*! 
    5057   \brief Get data writer object. 
     
    346353      if (!allDomainEmpty) 
    347354      { 
    348          StdString filename = (!name.isEmpty()) ?   name.getValue() : getId(); 
     355         StdString filename = getFileOutputName(); 
    349356         StdOStringStream oss; 
    350357         oss << filename; 
     
    457464    if (!allDomainEmpty) 
    458465    { 
    459       StdString filename = (!name.isEmpty()) ? name.getValue() : getId(); 
     466      StdString filename = getFileOutputName(); 
    460467      StdOStringStream oss; 
    461468      oss << filename; 
  • XIOS/trunk/src/node/file.hpp

    r651 r773  
    7171      public: 
    7272         /// Accesseurs /// 
     73         const StdString& getFileOutputName(void) const; 
    7374         boost::shared_ptr<CDataOutput> getDataOutput(void) const; 
    7475         boost::shared_ptr<CDataInput> getDataInput(void) const; 
  • XIOS/trunk/src/node/variable.cpp

    r595 r773  
    4545      } 
    4646      content = boost::trim_copy(content) ; 
     47   } 
     48 
     49   const StdString& CVariable::getVariableOutputName(void) const 
     50   { 
     51     return name.isEmpty() ? getId() : name; 
    4752   } 
    4853 
  • XIOS/trunk/src/node/variable.hpp

    r591 r773  
    6262 
    6363            /// Accesseur /// 
     64            const StdString& getVariableOutputName(void) const; 
    6465            const StdString & getContent (void) const; 
    6566 
Note: See TracChangeset for help on using the changeset viewer.