Parameter class used to append to objects of type AString, which invokes the method of the according specialization of template struct AppendableTraits<ISReadLine,TChar,HeapAllocator>.
This then reads a line of text from the encapsulated std::istream and appends that line to the target AString.
This class can be created 'inline', similar to, for example, special types appendable to class AString. But in the common cases, where a series of lines are to be read from a std::istream, a local object of this type should be created. In the case of a reading-loop, it is efficient to place it outside such a 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 96 of file stdiostream.mpp.
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 alib::strings::compatibility::std::TISReadLine< TChar >::BufferSize |
The amount of characters that the buffer is increased while reading parts of the line.
Definition at line 105 of file stdiostream.mpp.
bool alib::strings::compatibility::std::TISReadLine< TChar >::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 113 of file stdiostream.mpp.
::std::basic_istream<TChar>* alib::strings::compatibility::std::TISReadLine< TChar >::IStream |
The input stream to read from.
Definition at line 99 of file stdiostream.mpp.
integer alib::strings::compatibility::std::TISReadLine< TChar >::MaxLineWidth |
The maximum length of a single line to be read. Longer lines get truncated.
Definition at line 108 of file stdiostream.mpp.
lang::CurrentData alib::strings::compatibility::std::TISReadLine< TChar >::TargetData |
If CurrentData::KEEP
, the target AString
is not cleared before the read operation.
Definition at line 102 of file stdiostream.mpp.
|
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 127 of file stdiostream.mpp.