Jpp
Public 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

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 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

◆ JStreamState() [1/2]

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  }

◆ JStreamState() [2/2]

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  }

◆ ~JStreamState()

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  }

Member Data Documentation

◆ __from

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

Definition at line 67 of file JStreamState.hh.

◆ __to

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:
JLANG::JStreamState::__from
std::ios & __from
Definition: JStreamState.hh:67
JLANG::JStreamState::__to
std::ios & __to
Definition: JStreamState.hh:68