Changeset 1618
- Timestamp:
- 11/28/18 18:38:47 (6 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
XIOS/trunk/src/io/onetcdf4_impl.hpp
r1442 r1618 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 ; 76 78 Array<StdString,1>::const_iterator it, itb=data.begin(), ite=data.end() ; 77 int lineNb = 0; 78 for(it=itb;it!=ite;++it) 79 for(it=itb;it!=ite;++it, offset+=stringArrayLen) 79 80 { 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; 81 it->copy(PtrArrayStr+offset,it->size()) ; 82 PtrArrayStr[offset+it->size()]='\0' ; 90 83 } 84 85 CTimer::get("CONetCDF4::writeData writeData_").resume(); 86 this->writeData_(grpid, varid, sstart, scount, PtrArrayStr); 87 CTimer::get("CONetCDF4::writeData writeData_").suspend(); 88 91 89 delete [] PtrArrayStr; 92 90 }
Note: See TracChangeset
for help on using the changeset viewer.