Jpp test-rotations-new
the software that should make you happy
Loading...
Searching...
No Matches
JFormat_t Struct Reference

Data structure for format specifications. More...

#include <JManip.hh>

Inheritance diagram for JFormat_t:
JFormat

Public Types

typedef std::ios_base::fmtflags fmtflags
 

Public Member Functions

 JFormat_t ()
 Default constructor.
 
 JFormat_t (const int width, const int precision=0, const fmtflags flags=fmtflags(), const char fill=' ')
 Constructor.
 
 JFormat_t (std::ostream &out)
 Constructor.
 
bool is_valid () const
 Check validity of this manipulator.
 
void get (std::ostream &out)
 Get format specificaton from given output stream.
 
void put (std::ostream &out) const
 Put format specificaton to given output stream.
 

Public Attributes

int width
 
int precision
 
fmtflags flags
 
char fill
 

Friends

std::ostream & operator<< (std::ostream &out, const JFormat_t &format)
 Format specifier.
 

Detailed Description

Data structure for format specifications.

Definition at line 524 of file JManip.hh.

Member Typedef Documentation

◆ fmtflags

std::ios_base::fmtflags JFormat_t::fmtflags

Definition at line 526 of file JManip.hh.

Constructor & Destructor Documentation

◆ JFormat_t() [1/3]

JFormat_t::JFormat_t ( )
inline

Default constructor.

Definition at line 531 of file JManip.hh.

531 :
532 width (0),
533 precision(0),
534 flags (),
535 fill (' ')
536 {}
int precision
Definition JManip.hh:623
fmtflags flags
Definition JManip.hh:624
int width
Definition JManip.hh:622
char fill
Definition JManip.hh:625

◆ JFormat_t() [2/3]

JFormat_t::JFormat_t ( const int width,
const int precision = 0,
const fmtflags flags = fmtflags(),
const char fill = ' ' )
inline

Constructor.

Parameters
widthwidth
precisionprecision
flagsflags
fillfill character

Definition at line 547 of file JManip.hh.

550 :
551 width (width),
553 flags (flags),
554 fill (fill)
555 {}

◆ JFormat_t() [3/3]

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

Constructor.

Parameters
outoutput stream

Definition at line 563 of file JManip.hh.

564 {
565 get(out);
566 }
void get(std::ostream &out)
Get format specificaton from given output stream.
Definition JManip.hh:585

Member Function Documentation

◆ is_valid()

bool JFormat_t::is_valid ( ) const
inline

Check validity of this manipulator.

Returns
true if valid; else false

Definition at line 574 of file JManip.hh.

575 {
576 return (width > 0);
577 }

◆ get()

void JFormat_t::get ( std::ostream & out)
inline

Get format specificaton from given output stream.

Parameters
outoutput stream

Definition at line 585 of file JManip.hh.

586 {
587 this->width = out.width();
588 this->precision = out.precision();
589 this->flags = out.flags();
590 this->fill = out.fill();
591 }

◆ put()

void JFormat_t::put ( std::ostream & out) const
inline

Put format specificaton to given output stream.

Parameters
outoutput stream

Definition at line 599 of file JManip.hh.

600 {
601 out.width (this->width);
602 out.precision(this->precision);
603 out.flags (this->flags);
604 out.fill (this->fill);
605 }

Friends And Related Symbol Documentation

◆ operator<<

std::ostream & operator<< ( std::ostream & out,
const JFormat_t & format )
friend

Format specifier.

Parameters
outoutput stream
formatformat
Returns
output stream

Definition at line 615 of file JManip.hh.

616 {
617 format.put(out);
618
619 return out;
620 }
void put(std::ostream &out) const
Put format specificaton to given output stream.
Definition JManip.hh:599

Member Data Documentation

◆ width

int JFormat_t::width

Definition at line 622 of file JManip.hh.

◆ precision

int JFormat_t::precision

Definition at line 623 of file JManip.hh.

◆ flags

fmtflags JFormat_t::flags

Definition at line 624 of file JManip.hh.

◆ fill

char JFormat_t::fill

Definition at line 625 of file JManip.hh.


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