Jpp
Public Member Functions | Protected Attributes | List of all members
JFlags Struct Reference

Auxiliary class to temporarily modify format specifications. More...

#include <JPrint.hh>

Public Member Functions

 JFlags (std::ostream &out)
 Constructor. More...
 
 JFlags (std::ostream &out, std::ios::fmtflags flags)
 Constructor. More...
 
 JFlags (std::ostream &out, std::ios::fmtflags flags, std::ios::fmtflags mask)
 Constructor. More...
 
 ~JFlags ()
 Destructor. More...
 

Protected Attributes

std::ostream & __out
 
std::ios::fmtflags __flags
 
std::ios::fmtflags __mask
 

Detailed Description

Auxiliary class to temporarily modify format specifications.

Definition at line 617 of file JPrint.hh.

Constructor & Destructor Documentation

◆ JFlags() [1/3]

JFlags::JFlags ( std::ostream &  out)
inline

Constructor.

Parameters
outoutput stream

Definition at line 623 of file JPrint.hh.

623  :
624  __out(out)
625  {
626  __flags = out.flags();
627  }

◆ JFlags() [2/3]

JFlags::JFlags ( std::ostream &  out,
std::ios::fmtflags  flags 
)
inline

Constructor.

Parameters
outoutput stream
flagsformat flags

Definition at line 636 of file JPrint.hh.

636  :
637  __out(out)
638  {
639  __flags = out.flags();
640 
641  out.setf(flags);
642  }

◆ JFlags() [3/3]

JFlags::JFlags ( std::ostream &  out,
std::ios::fmtflags  flags,
std::ios::fmtflags  mask 
)
inline

Constructor.

Parameters
outoutput stream
flagsformat flags
maskformat mask

Definition at line 652 of file JPrint.hh.

652  :
653  __out(out)
654  {
655  __flags = out.flags();
656 
657  out.setf(flags, mask);
658  }

◆ ~JFlags()

JFlags::~JFlags ( )
inline

Destructor.

This destructor restores the old format specifications.

Definition at line 666 of file JPrint.hh.

667  {
668  __out.flags(__flags);
669  }

Member Data Documentation

◆ __out

std::ostream& JFlags::__out
protected

Definition at line 672 of file JPrint.hh.

◆ __flags

std::ios::fmtflags JFlags::__flags
protected

Definition at line 673 of file JPrint.hh.

◆ __mask

std::ios::fmtflags JFlags::__mask
protected

Definition at line 674 of file JPrint.hh.


The documentation for this struct was generated from the following file:
JFlags::__out
std::ostream & __out
Definition: JPrint.hh:672
JFlags::__flags
std::ios::fmtflags __flags
Definition: JPrint.hh:673