Changeset 127 for XMLIO_V2/dev/dev_rv/src/XMLIO/attribut.hpp
- Timestamp:
- 10/07/10 16:17:04 (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
XMLIO_V2/dev/dev_rv/src/XMLIO/attribut.hpp
r126 r127 86 86 { _hasValue = true ; value.resize(val.shape()); value = val ; } 87 87 88 #define PRINT_ARRAY(type) \ 89 template <> \ 90 ostream& Attribut<Array<type, 1> >::print(ostream & _out) const \ 91 { \ 92 if (_hasValue) _out << " " << getName() << "=\"" << value(0); \ 93 _out << "..." << value(value.size()-1); _out << "\"" ; \ 94 return (_out) ; \ 95 } 96 88 97 #define SET_ARRAY_TYPE(type) \ 89 SET_ARRAY_DIM(type,1) \ 90 SET_ARRAY_DIM(type,2) \ 91 SET_ARRAY_DIM(type,3) \ 92 SET_ARRAY_DIM(type,4) 98 PRINT_ARRAY(type) \ 99 SET_ARRAY_DIM(type, 1) \ 100 SET_ARRAY_DIM(type, 2) \ 101 SET_ARRAY_DIM(type, 3) \ 102 SET_ARRAY_DIM(type, 4) 93 103 94 104 SET_ARRAY_TYPE(double) 105 SET_ARRAY_TYPE(float) 95 106 SET_ARRAY_TYPE(int) 96 107 SET_ARRAY_TYPE(bool) 97 108 98 template <> 99 ostream& Attribut<Array<double,1> >::print(ostream & o) const 100 { 101 if (_hasValue) o << " " << getName() << "=\"" << value(0); 102 /*for (int i = 1; i < value.size(); i++) 103 { o << "," << value(i); }*/ 104 o << value(0) << "..." << value(value.size()-1); 105 o << "\"" ; 106 return (o) ; 107 } 109 #undef SET_ARRAY_DIM 110 #undef SET_ARRAY_TYPE 111 #undef PRINT_ARRAY 108 112 109 113 template <> 110 void Attribut<Array<double, 1> >::setFromString(const std::string& _str)114 void Attribut<Array<double, 1> >::setFromString(const std::string& _str) 111 115 { 112 116 istringstream iss(_str) ;
Note: See TracChangeset
for help on using the changeset viewer.