- Timestamp:
- 12/09/14 13:02:34 (9 years ago)
- Location:
- XIOS
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
XIOS/branchs/xios-1.0/src/node/variable.hpp
r501 r530 98 98 }; // class CVar 99 99 100 template<>101 inline bool CVariable::getData(void) const102 {103 if (content.compare("true")==0 || content.compare(".true.")==0 || content.compare(".TRUE.")==0) return true ;104 else if (content.compare("false")==0 || content.compare(".false.")==0 || content.compare(".FALSE.")==0) return false ;105 else ERROR("CVariable::getdata()",106 << "Cannot convert string <" << content << "> into type required" );107 return false ;108 }109 110 100 template <typename T> 111 101 inline T CVariable::getData(void) const … … 119 109 return retval ; 120 110 } 111 112 template<> 113 inline bool CVariable::getData(void) const 114 { 115 if (content.compare("true")==0 || content.compare(".true.")==0 || content.compare(".TRUE.")==0) return true ; 116 else if (content.compare("false")==0 || content.compare(".false.")==0 || content.compare(".FALSE.")==0) return false ; 117 else ERROR("CVariable::getdata()", 118 << "Cannot convert string <" << content << "> into type required" ); 119 return false ; 120 } 121 122 template<> 123 inline std::string CVariable::getData(void) const 124 { return content; } 121 125 122 126 template<> -
XIOS/trunk/src/node/variable.hpp
r527 r530 94 94 }; // class CVar 95 95 96 template<>97 inline bool CVariable::getData(void) const98 {99 if (content.compare("true")==0 || content.compare(".true.")==0 || content.compare(".TRUE.")==0) return true ;100 else if (content.compare("false")==0 || content.compare(".false.")==0 || content.compare(".FALSE.")==0) return false ;101 else ERROR("CVariable::getdata()",102 << "Cannot convert string <" << content << "> into type required" );103 return false ;104 }105 106 96 template <typename T> 107 97 inline T CVariable::getData(void) const … … 115 105 return retval ; 116 106 } 107 108 template<> 109 inline bool CVariable::getData(void) const 110 { 111 if (content.compare("true")==0 || content.compare(".true.")==0 || content.compare(".TRUE.")==0) return true ; 112 else if (content.compare("false")==0 || content.compare(".false.")==0 || content.compare(".FALSE.")==0) return false ; 113 else ERROR("CVariable::getdata()", 114 << "Cannot convert string <" << content << "> into type required" ); 115 return false ; 116 } 117 118 template<> 119 inline std::string CVariable::getData(void) const 120 { return content; } 117 121 118 122 template<>
Note: See TracChangeset
for help on using the changeset viewer.