Auxiliary tool for buffered reading of lines from input stream.
More...
#include <Standard_ReadLineBuffer.hxx>
|
bool | readStream (std::istream &theStream, size_t theLen, size_t &theReadLen) |
| Read from stl stream. More...
|
|
bool | readStream (FILE *theStream, size_t theLen, size_t &theReadLen) |
| Read from FILE stream. More...
|
|
Auxiliary tool for buffered reading of lines from input stream.
◆ Standard_ReadLineBuffer()
Standard_ReadLineBuffer::Standard_ReadLineBuffer |
( |
size_t |
theMaxBufferSizeBytes | ) |
|
|
inline |
Constructor with initialization.
- Parameters
-
theMaxBufferSizeBytes | the length of buffer to read (in bytes) |
◆ ~Standard_ReadLineBuffer()
virtual Standard_ReadLineBuffer::~Standard_ReadLineBuffer |
( |
| ) |
|
|
inlinevirtual |
◆ Clear()
void Standard_ReadLineBuffer::Clear |
( |
| ) |
|
|
inline |
Clear buffer and cached values.
◆ ReadLine() [1/2]
template<typename Stream_T >
const char* Standard_ReadLineBuffer::ReadLine |
( |
Stream_T & |
theStream, |
|
|
size_t & |
theLineLength |
|
) |
| |
|
inline |
Read next line from the stream.
- Returns
- pointer to the line or NULL on error / end of reading buffer (in case of NULL result theStream should be checked externally to identify the presence of errors). Empty lines will be returned also with zero length.
- Parameters
-
theLineLength | [out] - output parameter defined length of returned line. |
◆ ReadLine() [2/2]
template<typename Stream_T >
const char* Standard_ReadLineBuffer::ReadLine |
( |
Stream_T & |
theStream, |
|
|
size_t & |
theLineLength, |
|
|
int64_t & |
theReadData |
|
) |
| |
|
inline |
Read next line from the stream.
- Returns
- pointer to the line or NULL on error / end of reading buffer (in case of NULL result theStream should be checked externally to identify the presence of errors). Empty lines will be returned also with zero length.
- Parameters
-
theLineLength | [out] - output parameter defined length of returned line. |
theReadData | [out] - output parameter defined the number of elements successfully read from the stream during this call, it can be zero if no data was read and the line is taken from the buffer. |
◆ readStream() [1/2]
bool Standard_ReadLineBuffer::readStream |
( |
std::istream & |
theStream, |
|
|
size_t |
theLen, |
|
|
size_t & |
theReadLen |
|
) |
| |
|
inlineprotected |
Read from stl stream.
- Returns
- true if reading was finished without errors.
◆ readStream() [2/2]
bool Standard_ReadLineBuffer::readStream |
( |
FILE * |
theStream, |
|
|
size_t |
theLen, |
|
|
size_t & |
theReadLen |
|
) |
| |
|
inlineprotected |
Read from FILE stream.
- Returns
- true if reading was finished without errors.
◆ myBufferPos
size_t Standard_ReadLineBuffer::myBufferPos |
|
protected |
Current position in myReadBuffer.
◆ myBytesLastRead
size_t Standard_ReadLineBuffer::myBytesLastRead |
|
protected |
The number of characters that were read last time from myReadBuffer.
◆ myReadBuffer
std::vector<char> Standard_ReadLineBuffer::myReadBuffer |
|
protected |
◆ myReadBufferLastStr
std::vector<char> Standard_ReadLineBuffer::myReadBufferLastStr |
|
protected |
Part of last string of myReadBuffer.
◆ myUseReadBufferLastStr
bool Standard_ReadLineBuffer::myUseReadBufferLastStr |
|
protected |
Flag to use myReadBufferLastStr during next line reading.
The documentation for this class was generated from the following file: