本文整理汇总了C++中VSIVirtualHandle::Eof方法的典型用法代码示例。如果您正苦于以下问题:C++ VSIVirtualHandle::Eof方法的具体用法?C++ VSIVirtualHandle::Eof怎么用?C++ VSIVirtualHandle::Eof使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类VSIVirtualHandle
的用法示例。
在下文中一共展示了VSIVirtualHandle::Eof方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: VSIFEofL
int VSIFEofL( VSILFILE * fp )
{
VSIVirtualHandle *poFileHandle = (VSIVirtualHandle *) fp;
return poFileHandle->Eof();
}
示例2: VSIFEofL
int VSIFEofL( VSILFILE * fp )
{
VSIVirtualHandle *poFileHandle = reinterpret_cast<VSIVirtualHandle *>( fp );
return poFileHandle->Eof();
}
示例3: Eof
int VSIStdoutRedirectHandle::Eof()
{
return poHandle->Eof();
}
示例4: Read
size_t VSIBufferedReaderHandle::Read( void *pBuffer, size_t nSize, size_t nMemb )
{
const size_t nTotalToRead = nSize * nMemb;
//CPLDebug( "BUFFERED", "Read(%d)", (int)nTotalToRead);
if (nSize == 0)
return 0;
if (nBufferSize != 0 &&
nCurOffset >= nBufferOffset && nCurOffset <= nBufferOffset + nBufferSize)
{
/* We try to read from an offset located within the buffer */
const int nReadInBuffer = (int) MIN(nTotalToRead, nBufferOffset + nBufferSize - nCurOffset);
memcpy(pBuffer, pabyBuffer + nCurOffset - nBufferOffset, nReadInBuffer);
const int nToReadInFile = nTotalToRead - nReadInBuffer;
if (nToReadInFile > 0)
{
/* The beginning of the the data to read is located in the buffer */
/* but the end must be read from the file */
if (bNeedBaseHandleSeek)
poBaseHandle->Seek(nBufferOffset + nBufferSize, SEEK_SET);
bNeedBaseHandleSeek = FALSE;
//CPLAssert(poBaseHandle->Tell() == nBufferOffset + nBufferSize);
const int nReadInFile = poBaseHandle->Read((GByte*)pBuffer + nReadInBuffer, 1, nToReadInFile);
const int nRead = nReadInBuffer + nReadInFile;
nBufferSize = MIN(nRead, MAX_BUFFER_SIZE);
nBufferOffset = nCurOffset + nRead - nBufferSize;
memcpy(pabyBuffer, (GByte*)pBuffer + nRead - nBufferSize, nBufferSize);
nCurOffset += nRead;
//CPLAssert(poBaseHandle->Tell() == nBufferOffset + nBufferSize);
//CPLAssert(poBaseHandle->Tell() == nCurOffset);
bEOF = poBaseHandle->Eof();
return nRead / nSize;
}
else
{
/* The data to read is completely located within the buffer */
nCurOffset += nTotalToRead;
return nTotalToRead / nSize;
}
}
else
{
/* We try either to read before or after the buffer, so a seek is necessary */
poBaseHandle->Seek(nCurOffset, SEEK_SET);
bNeedBaseHandleSeek = FALSE;
const int nReadInFile = poBaseHandle->Read(pBuffer, 1, nTotalToRead);
nBufferSize = MIN(nReadInFile, MAX_BUFFER_SIZE);
nBufferOffset = nCurOffset + nReadInFile - nBufferSize;
memcpy(pabyBuffer, (GByte*)pBuffer + nReadInFile - nBufferSize, nBufferSize);
nCurOffset += nReadInFile;
//CPLAssert(poBaseHandle->Tell() == nBufferOffset + nBufferSize);
//CPLAssert(poBaseHandle->Tell() == nCurOffset);
bEOF = poBaseHandle->Eof();
return nReadInFile / nSize;
}
}