Jpp  17.0.0-rc.1
the software that should make you happy
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
Public Types | Public Member Functions | Public Attributes | Private Attributes | List of all members
JFormat Struct Reference

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

#include <JManip.hh>

Inheritance diagram for JFormat:
JFormat_t

Public Types

typedef std::ios_base::fmtflags fmtflags
 

Public Member Functions

 JFormat (std::ostream &out)
 Constructor. More...
 
 JFormat (std::ostream &out, const JFormat_t &format)
 Constructor. More...
 
 ~JFormat ()
 Destructor. More...
 
bool is_valid () const
 Check validity of this manipulator. More...
 
void get (std::ostream &out)
 Get format specificaton from given output stream. More...
 
void put (std::ostream &out) const
 Put format specificaton to given output stream. More...
 

Public Attributes

int width
 
int precision
 
fmtflags flags
 
char fill
 

Private Attributes

std::ostream & out
 
const JFormat_t format
 

Detailed Description

Auxiliary class to temporarily define format specifications.

The format specification of the output stream in use will be restored when this object is destroyed.

Definition at line 632 of file JManip.hh.

Member Typedef Documentation

typedef std::ios_base::fmtflags JFormat_t::fmtflags
inherited

Definition at line 524 of file JManip.hh.

Constructor & Destructor Documentation

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

Constructor.

Parameters
outoutput stream

Definition at line 640 of file JManip.hh.

640  :
641  JFormat_t(),
642  out (out),
643  format (out)
644  {}
JFormat_t()
Default constructor.
Definition: JManip.hh:529
std::ostream & out
Definition: JManip.hh:669
const JFormat_t format
Definition: JManip.hh:670
JFormat::JFormat ( std::ostream &  out,
const JFormat_t format 
)
inline

Constructor.

Parameters
outoutput stream
formatformat

Definition at line 653 of file JManip.hh.

653  :
654  JFormat_t(format),
655  out (out),
656  format (out)
657  {}
JFormat_t()
Default constructor.
Definition: JManip.hh:529
std::ostream & out
Definition: JManip.hh:669
const JFormat_t format
Definition: JManip.hh:670
JFormat::~JFormat ( )
inline

Destructor.

Definition at line 663 of file JManip.hh.

664  {
665  format.put(out);
666  }
void put(std::ostream &out) const
Put format specificaton to given output stream.
Definition: JManip.hh:597
std::ostream & out
Definition: JManip.hh:669
const JFormat_t format
Definition: JManip.hh:670

Member Function Documentation

bool JFormat_t::is_valid ( ) const
inlineinherited

Check validity of this manipulator.

Returns
true if valid; else false

Definition at line 572 of file JManip.hh.

573  {
574  return (width > 0);
575  }
int width
Definition: JManip.hh:620
void JFormat_t::get ( std::ostream &  out)
inlineinherited

Get format specificaton from given output stream.

Parameters
outoutput stream

Definition at line 583 of file JManip.hh.

584  {
585  this->width = out.width();
586  this->precision = out.precision();
587  this->flags = out.flags();
588  this->fill = out.fill();
589  }
int width
Definition: JManip.hh:620
char fill
Definition: JManip.hh:623
int precision
Definition: JManip.hh:621
fmtflags flags
Definition: JManip.hh:622
void JFormat_t::put ( std::ostream &  out) const
inlineinherited

Put format specificaton to given output stream.

Parameters
outoutput stream

Definition at line 597 of file JManip.hh.

598  {
599  out.width (this->width);
600  out.precision(this->precision);
601  out.flags (this->flags);
602  out.fill (this->fill);
603  }
int width
Definition: JManip.hh:620
char fill
Definition: JManip.hh:623
int precision
Definition: JManip.hh:621
fmtflags flags
Definition: JManip.hh:622

Member Data Documentation

std::ostream& JFormat::out
private

Definition at line 669 of file JManip.hh.

const JFormat_t JFormat::format
private

Definition at line 670 of file JManip.hh.

int JFormat_t::width
inherited

Definition at line 620 of file JManip.hh.

int JFormat_t::precision
inherited

Definition at line 621 of file JManip.hh.

fmtflags JFormat_t::flags
inherited

Definition at line 622 of file JManip.hh.

char JFormat_t::fill
inherited

Definition at line 623 of file JManip.hh.


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