Ignore:
Timestamp:
05/18/11 17:47:46 (13 years ago)
Author:
hozdoba
Message:
 
File:
1 edited

Legend:

Unmodified
Added
Removed
  • XMLIO_V2/dev/dev_rv/src/xmlio/buffer.cpp

    r157 r196  
    2121      { 
    2222         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);        
    2337      } 
    2438 
     
    198212         ofs.close(); 
    199213      } 
    200  
     214       
     215      //--------------------------------------------------------------- 
     216       
    201217      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) 
    206225      { 
    207226         CBufferData  bufdata; 
     227         this->updateBufferData(position); 
    208228         this->getBufferData(bufdata, position); 
    209229         return (bufdata.size + bufdata.position); 
     
    214234      template <> 
    215235         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       
    218250      ///-------------------------------------------------------------- 
    219251 
Note: See TracChangeset for help on using the changeset viewer.