Open CASCADE Technology  7.4.0
Public Member Functions

Standard_ReadBuffer Class Reference

Auxiliary tool for buffered reading from input stream within chunks of constant size. More...

#include <Standard_ReadBuffer.hxx>

Public Member Functions

 Standard_ReadBuffer (int64_t theDataLen, size_t theChunkLen)
 Constructor with initialization. More...
 
void Init (int64_t theDataLen, size_t theChunkLen)
 Initialize the buffer. More...
 
bool IsDone () const
 Return TRUE if amount of read bytes is equal to requested length of entire data. More...
 
template<typename Chunk_T , typename Stream_T >
Chunk_T * ReadChunk (Stream_T &theStream)
 Read next chunk. More...
 
template<typename Stream_T >
char * ReadDataChunk (Stream_T &theStream)
 Read next chunk. More...
 

Detailed Description

Auxiliary tool for buffered reading from input stream within chunks of constant size.

Constructor & Destructor Documentation

◆ Standard_ReadBuffer()

Standard_ReadBuffer::Standard_ReadBuffer ( int64_t  theDataLen,
size_t  theChunkLen 
)
inline

Constructor with initialization.

Member Function Documentation

◆ Init()

void Standard_ReadBuffer::Init ( int64_t  theDataLen,
size_t  theChunkLen 
)
inline

Initialize the buffer.

Parameters
theDataLenthe full length of input data to read from stream.
theChunkLenthe length of single chunk to read

◆ IsDone()

bool Standard_ReadBuffer::IsDone ( ) const
inline

Return TRUE if amount of read bytes is equal to requested length of entire data.

◆ ReadChunk()

template<typename Chunk_T , typename Stream_T >
Chunk_T* Standard_ReadBuffer::ReadChunk ( Stream_T &  theStream)
inline

Read next chunk.

Returns
pointer to the chunk or NULL on error / end of reading buffer

◆ ReadDataChunk()

template<typename Stream_T >
char* Standard_ReadBuffer::ReadDataChunk ( Stream_T &  theStream)
inline

Read next chunk.

Returns
pointer to the chunk or NULL on error / end of reading buffer

The documentation for this class was generated from the following file: