Changeset 196 for XMLIO_V2/dev/dev_rv/src/xmlio/buffer.cpp
- Timestamp:
- 05/18/11 17:47:46 (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
XMLIO_V2/dev/dev_rv/src/xmlio/buffer.cpp
r157 r196 21 21 { 22 22 this->idata = data; 23 } 24 25 CBuffer::CBuffer(const CBuffer & buffer) 26 : size(buffer.size), delIdata(true) 27 { 28 this->idata = new char[size](); 29 std::copy (buffer.idata, buffer.idata+size, this->idata); 30 } 31 32 CBuffer::CBuffer(const CBuffer * const buffer) 33 : size(buffer->size), delIdata(true) 34 { 35 this->idata = new char[size](); 36 std::copy (buffer->idata, buffer->idata+size, this->idata); 23 37 } 24 38 … … 198 212 ofs.close(); 199 213 } 200 214 215 //--------------------------------------------------------------- 216 201 217 void CBuffer::printToBinaryStream (StdOStream & ostr) 202 { ostr.write (this->getData(), this->getSize()); } 203 204 205 StdSize CBuffer::getNextDataPosition(StdSize position) const 218 { 219 ostr.write (this->getData(), this->getSize()); 220 } 221 222 //--------------------------------------------------------------- 223 224 StdSize CBuffer::getNextDataPosition(StdSize position) 206 225 { 207 226 CBufferData bufdata; 227 this->updateBufferData(position); 208 228 this->getBufferData(bufdata, position); 209 229 return (bufdata.size + bufdata.position); … … 214 234 template <> 215 235 StdSize CBuffer::getRequestedSize(StdString data) const 216 { return (DATA_HEADER_SIZE + data.size() * sizeof (char)); } 217 236 { 237 return (DATA_HEADER_SIZE + data.size() * sizeof (char)); 238 } 239 240 //--------------------------------------------------------------- 241 242 void CBuffer::updateBufferData(StdSize position) 243 { 244 CBufferData bufdata; 245 this->getBufferData(bufdata, position); 246 bufdata.position = position + DATA_HEADER_SIZE; 247 this->setBufferData(bufdata, position); 248 } 249 218 250 ///-------------------------------------------------------------- 219 251
Note: See TracChangeset
for help on using the changeset viewer.