ALib C++ Library
Library Version: 2312 R0
Documentation generated by doxygen
Public Fields | Public Methods | List of all members
TISReadLine< TChar > Struct Template Reference

#include <std_strings_iostream.hpp>

Collaboration diagram for TISReadLine< TChar >:
[legend]

Class Description

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

Definition at line 87 of file std_strings_iostream.hpp.

Public Fields

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

Public Methods

 TISReadLine (::std::basic_istream< TChar > *istream, CurrentData targetData=CurrentData::Clear, integer bufferSize=256, integer maxLineWidth=4096)
 

Constructor & Destructor Documentation

◆ TISReadLine()

TISReadLine ( ::std::basic_istream< TChar > *  istream,
CurrentData  targetData = 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.

Member Data Documentation

◆ BufferSize

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

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

::std::basic_istream<TChar>* IStream

The input stream to read from.

Definition at line 90 of file std_strings_iostream.hpp.

◆ MaxLineWidth

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

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.


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