ITK  5.2.0
Insight Toolkit
Public Member Functions | Private Attributes | List of all members
itk::StdStreamStateSave Class Reference

#include <itkStdStreamStateSave.h>

+ Collaboration diagram for itk::StdStreamStateSave:

Public Member Functions

 StdStreamStateSave (std::ios &stream)
 
 ~StdStreamStateSave ()
 

Private Attributes

std::ios & m_Ios
 
std::ios m_State
 

Detailed Description

Save a stream's format state and restore it upon destruction.

An RAII class to provide an exception safe mechanism to restore the format state of a stream. The class holds a resource (the stream's format state) and resets the resource to a default state upon destruction.

Typical usage:

itk::StdStreamStateSave coutState(std::cout);
std::cout.precision(20);
std::cout.hex();
...
return;

Definition at line 47 of file itkStdStreamStateSave.h.

Constructor & Destructor Documentation

◆ StdStreamStateSave()

itk::StdStreamStateSave::StdStreamStateSave ( std::ios &  stream)
inlineexplicit

Definition at line 52 of file itkStdStreamStateSave.h.

References m_State.

◆ ~StdStreamStateSave()

itk::StdStreamStateSave::~StdStreamStateSave ( )
inline

Definition at line 58 of file itkStdStreamStateSave.h.

References m_Ios, and m_State.

Member Data Documentation

◆ m_Ios

std::ios& itk::StdStreamStateSave::m_Ios
private

Definition at line 61 of file itkStdStreamStateSave.h.

Referenced by ~StdStreamStateSave().

◆ m_State

std::ios itk::StdStreamStateSave::m_State
private

Definition at line 62 of file itkStdStreamStateSave.h.

Referenced by StdStreamStateSave(), and ~StdStreamStateSave().


The documentation for this class was generated from the following file:
itk::StdStreamStateSave
Save a stream's format state and restore it upon destruction.
Definition: itkStdStreamStateSave.h:47