CatapultServer  v0.5.0.1 (Elephant)
catapult::utils::StreamFormatGuard Class Reference
Inheritance diagram for catapult::utils::StreamFormatGuard:
Collaboration diagram for catapult::utils::StreamFormatGuard:

Public Member Functions

 StreamFormatGuard (std::ostream &out, std::ios_base::fmtflags flags, char fill)
 Creates a guard around out that sets format flags and character fill. More...
 
 ~StreamFormatGuard ()
 Destroys the guard and restores original stream formatting settings. More...
 
- Public Member Functions inherited from catapult::utils::NonCopyable
constexpr NonCopyable ()=default
 Default constructor. More...
 
 ~NonCopyable ()=default
 Default destructor. More...
 
 NonCopyable (const NonCopyable &)=delete
 Disabled copy constructor. More...
 
NonCopyableoperator= (const NonCopyable &)=delete
 Disabled assignment operator. More...
 

Private Attributes

std::ostream & m_out
 
std::ios_base::fmtflags m_flags
 
char m_fill
 

Detailed Description

RAII class for modifying and restoring ostream formatting options.

Note
stream width is not sticky so it doesn't need to be saved and restored even if it is modified.

Constructor & Destructor Documentation

◆ StreamFormatGuard()

catapult::utils::StreamFormatGuard::StreamFormatGuard ( std::ostream &  out,
std::ios_base::fmtflags  flags,
char  fill 
)
inline

Creates a guard around out that sets format flags and character fill.

◆ ~StreamFormatGuard()

catapult::utils::StreamFormatGuard::~StreamFormatGuard ( )
inline

Destroys the guard and restores original stream formatting settings.

Member Data Documentation

◆ m_fill

char catapult::utils::StreamFormatGuard::m_fill
private

◆ m_flags

std::ios_base::fmtflags catapult::utils::StreamFormatGuard::m_flags
private

◆ m_out

std::ostream& catapult::utils::StreamFormatGuard::m_out
private

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