Changeset 1873
- Timestamp:
- 05/06/20 11:16:20 (4 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
XIOS/branchs/xios-2.5/src/io/onetcdf4_impl.hpp
r1442 r1873 73 73 } 74 74 char *PtrArrayStr ; 75 PtrArrayStr=new char[stringArrayLen] ; 75 PtrArrayStr=new char[stringArrayLen*data.numElements()] ; 76 memset (PtrArrayStr,' ',stringArrayLen*data.numElements()); 77 size_t offset=0 ; 78 79 // pb with iterator with blitz++ string array with recent compiler 80 /* 76 81 Array<StdString,1>::const_iterator it, itb=data.begin(), ite=data.end() ; 77 int lineNb = 0; 78 for(it=itb;it!=ite;++it) 82 for(it=itb;it!=ite;++it, offset+=stringArrayLen) 79 83 { 80 it->copy(PtrArrayStr,it->size()) ; 81 PtrArrayStr[it->size()]='\0' ; 82 sstart[0] = lineNb; 83 sstart[dimArrayLen] = 0; 84 scount[0] = 1; 85 scount[dimArrayLen] = it->size() + 1; 86 CTimer::get("CONetCDF4::writeData writeData_").resume(); 87 this->writeData_(grpid, varid, sstart, scount, PtrArrayStr); 88 CTimer::get("CONetCDF4::writeData writeData_").suspend(); 89 ++lineNb; 84 it->copy(PtrArrayStr+offset,it->size()) ; 85 PtrArrayStr[offset+it->size()]='\0' ; 90 86 } 87 */ 88 for(int i=0;i<data.numElements();i++,offset+=stringArrayLen) 89 { 90 data(i).copy(PtrArrayStr+offset,data(i).size()) ; 91 PtrArrayStr[offset+data(i).size()]='\0' ; 92 } 93 CTimer::get("CONetCDF4::writeData writeData_").resume(); 94 this->writeData_(grpid, varid, sstart, scount, PtrArrayStr); 95 CTimer::get("CONetCDF4::writeData writeData_").suspend(); 96 91 97 delete [] PtrArrayStr; 92 98 }
Note: See TracChangeset
for help on using the changeset viewer.