Jpp  18.3.1
the software that should make you happy
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
Public Member Functions | Private Member Functions | Private Attributes | List of all members
JLANG::JStreamState Class Reference

This class can be used to temporarily exchange the states between streams. More...

#include <JStreamState.hh>

Inheritance diagram for JLANG::JStreamState:
JLANG::JStringStream JROOT::JRootReader JROOT::JRootWriter JDATABASE::JDBReader< T > JAANET::JHeadWriter

Public Member Functions

 JStreamState (std::ostream &from, std::ostream &to)
 Constructor. More...
 
 JStreamState (std::istream &from, std::istream &to)
 Constructor. More...
 
 ~JStreamState ()
 Destructor. More...
 

Private Member Functions

 JStreamState (const JStreamState &)
 
 JStreamState (JStreamState &&)
 
JStreamStateoperator= (const JStreamState &)
 
JStreamStateoperator= (JStreamState &&)
 

Private Attributes

std::ios & __from
 
std::ios & __to
 

Detailed Description

This class can be used to temporarily exchange the states between streams.

The constructor transfers the state from the first stream to the second stream and the destructor transfers back the state from the second stream to the first stream.

Definition at line 23 of file JStreamState.hh.

Constructor & Destructor Documentation

JLANG::JStreamState::JStreamState ( std::ostream &  from,
std::ostream &  to 
)
inline

Constructor.

The stream state of from is transfered to stream state of to.

Parameters
fromoutput stream
tooutput stream

Definition at line 32 of file JStreamState.hh.

33  :
34  __from(from),
35  __to (to)
36  {
37  __to.setstate(__from.rdstate());
38  }
JLANG::JStreamState::JStreamState ( std::istream &  from,
std::istream &  to 
)
inline

Constructor.

The stream state of from is transfered to stream state of to.

Parameters
frominput stream
toinput stream

Definition at line 48 of file JStreamState.hh.

49  :
50  __from(from),
51  __to (to)
52  {
53  __to.setstate(__from.rdstate());
54  }
JLANG::JStreamState::~JStreamState ( )
inline

Destructor.

The stream state is transfered back.

Definition at line 61 of file JStreamState.hh.

62  {
63  __from.setstate(__to.rdstate());
64  }
JLANG::JStreamState::JStreamState ( const JStreamState )
private
JLANG::JStreamState::JStreamState ( JStreamState &&  )
private

Member Function Documentation

JStreamState& JLANG::JStreamState::operator= ( const JStreamState )
private
JStreamState& JLANG::JStreamState::operator= ( JStreamState &&  )
private

Member Data Documentation

std::ios& JLANG::JStreamState::__from
private

Definition at line 67 of file JStreamState.hh.

std::ios& JLANG::JStreamState::__to
private

Definition at line 68 of file JStreamState.hh.


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