ALib C++ Library
Library Version: 2402 R1
Documentation generated by doxygen
Loading...
Searching...
No Matches
StringReader Class Reference

Description:


This class is a helper class that converts narrow string data read from an object of type std::istream to the default character type .

See also
Further explanations are given with sibling class StringWriter .

Definition at line 321 of file std_strings_iostream.hpp.

#include <std_strings_iostream.hpp>

Collaboration diagram for StringReader:
[legend]

Public Method Index:

 StringReader ()
 
::std::istream * GetStream ()
 
bool IsEOF ()
 
void Read (NAString &target)
 
void Read (WAString &target)
 
void SetStream (::std::istream *is)
 

Field Details:

◆ converter

NAString converter
protected

The string buffer used for conversion.

Definition at line 325 of file std_strings_iostream.hpp.

◆ readOp

The input stream as provided with SetStream. Will be set to the std::cin, respectively std::win in the constructor.

Definition at line 329 of file std_strings_iostream.hpp.

Constructor(s) / Destructor Details::

◆ StringReader()

StringReader ( )
inline

Constructor.Invokes SetStream passing std::cin.

Definition at line 336 of file std_strings_iostream.hpp.

Method Details:

◆ GetStream()

::std::istream * GetStream ( )
inline

Returns the input stream previously set with SetStream.

Returns
The input stream set with SetStream.

Definition at line 353 of file std_strings_iostream.hpp.

◆ IsEOF()

bool IsEOF ( )
inline

Returns true if the input stream signaled its end, false otherwise.

Returns
true if the input stream is known to be at its end, false otherwise.

Definition at line 360 of file std_strings_iostream.hpp.

◆ Read() [1/2]

void Read ( NAString & target)
inline

Reads one line of text from the input stream into a narrow string.

Parameters
targetThe storage buffer for the string to read. This string will be cleared independent of the availability of input data.

Definition at line 369 of file std_strings_iostream.hpp.

Here is the call graph for this function:

◆ Read() [2/2]

void Read ( WAString & target)
inline

Reads one line of text from the internal input stream into a wide string.

Parameters
targetThe storage buffer for the string to read. This string will be cleared independent of the availability of input data.

Definition at line 380 of file std_strings_iostream.hpp.

Here is the call graph for this function:

◆ SetStream()

void SetStream ( ::std::istream * is)
inline

Sets the input stream.

Parameters
isPointer to the input stream to read from to.

Definition at line 346 of file std_strings_iostream.hpp.


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