![]() |
Open CASCADE Technology Reference Manual 8.0.0
|
Auxiliary tool for buffered reading of lines from input stream. More...
#include <Standard_ReadLineBuffer.hxx>
Public Member Functions | |
| Standard_ReadLineBuffer (size_t theMaxBufferSizeBytes) | |
| Constructor with initialization. | |
| virtual | ~Standard_ReadLineBuffer ()=default |
| Destructor. | |
| void | Clear () |
| Clear buffer and cached values. | |
| template<typename Stream_T > | |
| const char * | ReadLine (Stream_T &theStream, size_t &theLineLength) |
| Read next line from the stream. | |
| template<typename Stream_T > | |
| const char * | ReadLine (Stream_T &theStream, size_t &theLineLength, int64_t &theReadData) |
| Read next line from the stream. | |
| 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: | |
| bool | ToPutGapInMultiline () const |
| Put gap space while merging lines within multiline syntax, so that the following sample: | |
| void | SetMultilineMode (bool theMultilineMode, bool theToPutGap=true) |
| Sets or unsets the multi-line mode. | |
Protected Member Functions | |
| bool | readStream (std::istream &theStream, size_t theLen, size_t &theReadLen) |
| Read from stl stream. | |
| bool | readStream (FILE *theStream, size_t theLen, size_t &theReadLen) |
| Read from FILE stream. | |
Protected Attributes | |
| NCollection_LinearVector< char > | myReadBuffer |
| Temp read buffer. | |
| NCollection_LinearVector< char > | myReadBufferLastStr |
| Part of last string of myReadBuffer. | |
| bool | myUseReadBufferLastStr |
| Flag to use myReadBufferLastStr during next line reading. | |
| bool | myIsMultilineMode |
| Flag to process of the special multi-line case at the end of the line. | |
| bool | myToPutGapInMultiline |
| Flag to put gap space while joining lines in multi-line syntax. | |
| size_t | myBufferPos |
| Current position in myReadBuffer. | |
| size_t | myBytesLastRead |
| The number of characters that were read last time from myReadBuffer. | |
Auxiliary tool for buffered reading of lines from input stream.
|
inline |
Constructor with initialization.
| theMaxBufferSizeBytes | the length of buffer to read (in bytes) |
|
virtualdefault |
Destructor.
|
inline |
Clear buffer and cached values.
|
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:
|
inline |
Read next line from the stream.
| theStream | [inout] - the stream to read from. | |
| [out] | theLineLength | - output parameter defined length of returned line. |
|
inline |
Read next line from the stream.
| theStream | [inout] - the stream to read from. | |
| [out] | theLineLength | - output parameter defined length of returned line. |
| [out] | theReadData | - 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. |
|
inlineprotected |
Read from FILE stream.
|
inlineprotected |
Read from stl stream.
|
inline |
Sets or unsets the multi-line mode.
| [in] | theMultilineMode | multiline mode flag |
| [in] | theToPutGap | put gap space while connecting lines (no gap otherwise) |
|
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.
|
protected |
Current position in myReadBuffer.
|
protected |
The number of characters that were read last time from myReadBuffer.
|
protected |
Flag to process of the special multi-line case at the end of the line.
|
protected |
Temp read buffer.
|
protected |
Part of last string of myReadBuffer.
|
protected |
Flag to put gap space while joining lines in multi-line syntax.
|
protected |
Flag to use myReadBufferLastStr during next line reading.