Parameter class used to append to objects of type AString, which invokes the method of the according specialization of template struct T_Append<ISReadLine,TChar,HeapAllocator>.
This then reads a line of text from the encapsulated std::istream and appends that line to the target AString.
While, of course, this class can be created 'inline' (for example, similar objects of parameter classes found in Format), in the usual case that a series of lines are to be read from a std::istream, a local object of this type might be created. In case of a reading loop, rather outside such loop.
Field IsEOF can be used to detect the end of the input stream.
TChar | The character type of the input stream as well as the receiving string. Specializations for character types nchar, wchar exist. Those have corresponding alias type definition shortcuts ISReadLineN and ISReadLineW in namespace alib. |
Definition at line 80 of file std_strings_iostream.hpp.
#include <std_strings_iostream.hpp>
Public Field Index: | |
integer | BufferSize |
The amount of characters that the buffer is increased while reading parts of the line. | |
bool | IsEOF = false |
::std::basic_istream< TChar > * | IStream |
The input stream to read from. | |
integer | MaxLineWidth |
The maximum length of a single line to be read. Longer lines get truncated. | |
lang::CurrentData | TargetData |
If CurrentData::KEEP , the target AString is not cleared before the read operation. | |
Public Method Index: | |
TISReadLine (::std::basic_istream< TChar > *istream, lang::CurrentData targetData=lang::CurrentData::Clear, integer bufferSize=256, integer maxLineWidth=4096) | |
integer BufferSize |
The amount of characters that the buffer is increased while reading parts of the line.
Definition at line 89 of file std_strings_iostream.hpp.
bool IsEOF = false |
Indicates if the end of the input stream was detected with the last read operation. If so, a next read operation will not change the string (or clear it, if TargetData is false
Definition at line 97 of file std_strings_iostream.hpp.
::std::basic_istream<TChar>* IStream |
The input stream to read from.
Definition at line 83 of file std_strings_iostream.hpp.
integer MaxLineWidth |
The maximum length of a single line to be read. Longer lines get truncated.
Definition at line 92 of file std_strings_iostream.hpp.
lang::CurrentData TargetData |
If CurrentData::KEEP
, the target AString
is not cleared before the read operation.
Definition at line 86 of file std_strings_iostream.hpp.
|
inline |
Constructor.
istream | The input stream to read from. |
targetData | If CurrentData::Keep , the target AString is not cleared before the read operation is performed. Defaults to CurrentData::Clear . |
bufferSize | The amount of characters that the buffer is increased while reading parts of the line. Defaults to 256 characters. |
maxLineWidth | The maximum length of a single line to be read. Longer lines get truncated. Defaults to 4096 characters. |
Definition at line 111 of file std_strings_iostream.hpp.