ALib C++ Library
Library Version: 2510 R0
Documentation generated by doxygen
Loading...
Searching...
No Matches
alib::strings::compatibility::std::TISReadLine< TChar > Struct Template Reference

Description:

template<typename TChar>
struct alib::strings::compatibility::std::TISReadLine< TChar >

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.

See also
Template Parameters
TCharThe 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.

Collaboration diagram for alib::strings::compatibility::std::TISReadLine< TChar >:
[legend]

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)
 

Field Details:

◆ BufferSize

template<typename TChar>
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.

◆ IsEOF

template<typename TChar>
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.

◆ IStream

template<typename TChar>
::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.

◆ MaxLineWidth

template<typename TChar>
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.

◆ TargetData

template<typename TChar>
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.

Constructor(s) / Destructor Details:

◆ TISReadLine()

template<typename TChar>
alib::strings::compatibility::std::TISReadLine< TChar >::TISReadLine ( ::std::basic_istream< TChar > * istream,
lang::CurrentData targetData = lang::CurrentData::Clear,
integer bufferSize = 256,
integer maxLineWidth = 4096 )
inline

Constructor.

Parameters
istreamThe input stream to read from.
targetDataIf CurrentData::Keep, the target AString is not cleared before the read operation is performed. Defaults to CurrentData::Clear.
bufferSizeThe amount of characters that the buffer is increased while reading parts of the line. Defaults to 256 characters.
maxLineWidthThe 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.


The documentation for this struct was generated from the following file: