Subversion Repositories spk

Rev

Rev 121 | Rev 124 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 121 Rev 123
Line 492... Line 492...
492
 
492
 
493
	m_fId.put(c);
493
	m_fId.put(c);
494
	return !m_fId.bad();
494
	return !m_fId.bad();
495
}
495
}
496
 
496
 
497
bool CFileIO::writeSize(unsigned int iSize)
497
bool CFileIO::writeSize(size_t iSize)
498
{
498
{
499
	if ( !this->isOpened() ) return false;
499
	if ( !this->isOpened() ) return false;
500
	if ( !this->put(static_cast<unsigned char>(iSize >> 24)) ) return false;
500
	if ( !this->put(static_cast<unsigned char>(iSize >> 24)) ) return false;
501
	if ( !this->put(static_cast<unsigned char>(iSize >> 16)) ) return false;
501
	if ( !this->put(static_cast<unsigned char>(iSize >> 16)) ) return false;
502
	if ( !this->put(static_cast<unsigned char>(iSize >> 8)) ) return false;
502
	if ( !this->put(static_cast<unsigned char>(iSize >> 8)) ) return false;
Line 536... Line 536...
536
	delete data;
536
	delete data;
537
 
537
 
538
	return bSuccess;
538
	return bSuccess;
539
}
539
}
540
 
540
 
541
bool CFileIO::write(const char *buf, unsigned int iSize)
541
bool CFileIO::write(const char *buf, size_t iSize)
542
{
542
{
543
	if ( !this->isOpened() ) startWrite();
543
	if ( !this->isOpened() ) startWrite();
544
	if ( !this->isOpened() ) return false;
544
	if ( !this->isOpened() ) return false;
545
	try {
545
	try {
546
		m_fId.write((char *)buf, iSize);
546
		m_fId.write((char *)buf, iSize);
Line 550... Line 550...
550
		return false;
550
		return false;
551
	}
551
	}
552
	m_lSize += iSize;
552
	m_lSize += iSize;
553
	return !m_fId.bad();
553
	return !m_fId.bad();
554
}
554
}
555
bool CFileIO::write(const unsigned char *buf, unsigned int iSize)
555
bool CFileIO::write(const unsigned char *buf, size_t iSize)
556
{
556
{
557
	return this->write((char *)buf, iSize);
557
	return this->write((char *)buf, iSize);
558
}
558
}
559
 
559
 
560
bool CFileIO::write(const unsigned char *buf, ...)
560
bool CFileIO::write(const unsigned char *buf, ...)
Line 600... Line 600...
600
	}
600
	}
601
	if ( m_bSeekP ) m_fId.seekp(iPos, iFrom);
601
	if ( m_bSeekP ) m_fId.seekp(iPos, iFrom);
602
	else m_fId.seekg(iPos, iFrom);
602
	else m_fId.seekg(iPos, iFrom);
603
}
603
}
604
 
604
 
605
void CFileIO::seek(unsigned int iPos)
605
void CFileIO::seek(size_t iPos)
606
{
606
{
607
	_seek(iPos, std::ios::cur);
607
	_seek(iPos, std::ios::cur);
608
}
608
}
609
 
609
 
610
void CFileIO::seekEnd(unsigned int iPos)
610
void CFileIO::seekEnd(size_t iPos)
611
{
611
{
612
	_seek(iPos, std::ios::end);
612
	_seek(iPos, std::ios::end);
613
}
613
}
614
 
614
 
615
void CFileIO::seekStart(unsigned int iPos)
615
void CFileIO::seekStart(size_t iPos)
616
{
616
{
617
	_seek(iPos, std::ios::beg);
617
	_seek(iPos, std::ios::beg);
618
}
618
}
619
 
619
 
620
std::fstream &CFileIO::stream()
620
std::fstream &CFileIO::stream()