ALib C++ Library
Library Version: 2402 R1
Documentation generated by doxygen
Loading...
Searching...
No Matches
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 T_Append<ISReadLine,TChar>.
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.

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 87 of file std_strings_iostream.hpp.

#include <std_strings_iostream.hpp>

Collaboration diagram for TISReadLine< TChar >:
[legend]

Public Field Index:

integer BufferSize
 
bool IsEOF = false
 
::std::basic_istream< TChar > * IStream
 
integer MaxLineWidth
 
lang::CurrentData TargetData
 

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 BufferSize

The amount of characters that the buffer is increased while reading parts of the line.

Definition at line 96 of file std_strings_iostream.hpp.

◆ IsEOF

template<typename TChar >
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 106 of file std_strings_iostream.hpp.

◆ IStream

template<typename TChar >
::std::basic_istream<TChar>* IStream

The input stream to read from.

Definition at line 90 of file std_strings_iostream.hpp.

◆ MaxLineWidth

template<typename TChar >
integer MaxLineWidth

The maximum length of a single line to be read. Longer lines get truncated.

Definition at line 99 of file std_strings_iostream.hpp.

◆ TargetData

template<typename TChar >
lang::CurrentData TargetData

If CurrentData::KEEP, the target AString is not cleared before the read operation.

Definition at line 93 of file std_strings_iostream.hpp.

Constructor(s) / Destructor Details::

◆ TISReadLine()

template<typename 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 120 of file std_strings_iostream.hpp.


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