ALib C++ Library
Library Version: 2312 R0
Documentation generated by doxygen
Public Methods | Protected Fields | List of all members
StringReader Class Reference

#include <std_strings_iostream.hpp>

Collaboration diagram for StringReader:
[legend]

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

Public Methods

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

Protected Fields

NAString converter
 
compatibility::std::TISReadLine< ncharreadOp
 

Constructor & Destructor Documentation

◆ StringReader()

StringReader ( )
inline

Constructor.Invokes SetStream passing std::cin.

Definition at line 335 of file std_strings_iostream.hpp.

Member Function Documentation

◆ GetStream()

::std::istream* GetStream ( )
inline

Returns the input stream previously set with SetStream.

Returns
The input stream set with SetStream.

Definition at line 352 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 359 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 368 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 379 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 345 of file std_strings_iostream.hpp.

Member Data Documentation

◆ converter

NAString converter
protected

The string buffer used for conversion.

Definition at line 324 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 328 of file std_strings_iostream.hpp.


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