Auxiliary tool for buffered reading of lines from input stream.
More...
#include <Standard_ReadLineBuffer.hxx>
|
| Standard_ReadLineBuffer (size_t theMaxBufferSizeBytes) |
| Constructor with initialization. More...
|
|
virtual | ~Standard_ReadLineBuffer () |
| Destructor. More...
|
|
void | Clear () |
| Clear buffer and cached values. More...
|
|
template<typename Stream_T > |
const char * | ReadLine (Stream_T &theStream, size_t &theLineLength) |
| Read next line from the stream. More...
|
|
template<typename Stream_T > |
const char * | ReadLine (Stream_T &theStream, size_t &theLineLength, int64_t &theReadData) |
| Read next line from the stream. More...
|
|
bool | IsMultilineMode () const |
| Returns TRUE when the Multiline Mode is on; FALSE by default. Multiline modes joins several lines in file having \ at the end of line: More...
|
|
bool | ToPutGapInMultiline () const |
| Put gap space while merging lines within multiline syntax, so that the following sample: More...
|
|
void | SetMultilineMode (bool theMultilineMode, bool theToPutGap=true) |
| Sets or unsets the multi-line mode. More...
|
|
|
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.
◆ IsMultilineMode()
bool Standard_ReadLineBuffer::IsMultilineMode |
( |
| ) |
const |
|
inline |
Returns TRUE when the Multiline Mode is on; FALSE by default. Multiline modes joins several lines in file having \ at the end of line:
Line starts here, \
continues \
and ends.
◆ 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
-
theStream | [inout] - the stream to read from. |
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
-
theStream | [inout] - the stream to read from. |
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 |
( |
FILE * |
theStream, |
|
|
size_t |
theLen, |
|
|
size_t & |
theReadLen |
|
) |
| |
|
inlineprotected |
Read from FILE stream.
- Returns
- true if reading was finished without errors.
◆ readStream() [2/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.
◆ SetMultilineMode()
void Standard_ReadLineBuffer::SetMultilineMode |
( |
bool |
theMultilineMode, |
|
|
bool |
theToPutGap = true |
|
) |
| |
|
inline |
Sets or unsets the multi-line mode.
- Parameters
-
theMultilineMode | [in] multiline mode flag |
theToPutGap | [in] put gap space while connecting lines (no gap otherwise) |
◆ ToPutGapInMultiline()
bool Standard_ReadLineBuffer::ToPutGapInMultiline |
( |
| ) |
const |
|
inline |
Put gap space while merging lines within multiline syntax, so that the following sample:
Will become "1/2/3 4/5/6" when flag is TRUE, and "1/2/35/5/6" otherwise.
◆ 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.
◆ myIsMultilineMode
bool Standard_ReadLineBuffer::myIsMultilineMode |
|
protected |
Flag to process of the special multi-line case at the end of the line.
◆ myReadBuffer
std::vector<char> Standard_ReadLineBuffer::myReadBuffer |
|
protected |
◆ myReadBufferLastStr
std::vector<char> Standard_ReadLineBuffer::myReadBufferLastStr |
|
protected |
Part of last string of myReadBuffer.
◆ myToPutGapInMultiline
bool Standard_ReadLineBuffer::myToPutGapInMultiline |
|
protected |
Flag to put gap space while joining lines in multi-line syntax.
◆ 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: