Public Member Functions | Private Attributes | Friends | List of all members
gnsstk::format Class Reference

Detailed Description

Class format holds 3 flags for format, width and precision; use with std ostream operator <<

Definition at line 51 of file format.hpp.

#include <format.hpp>

Public Member Functions

formatfix ()
 Set format to fixed. More...
 
formatfixed ()
 Set format to fixed. More...
 
 format (int w, int p, int f=1)
 Constructor. More...
 
formatgen ()
 Set format to general. More...
 
formatgeneral ()
 Set format to general. More...
 
formatp (int p)
 Set precision to p digits. More...
 
formatprecision (int p)
 Set precision to p digits. More...
 
formatsci ()
 Set format to scientific. More...
 
formatscientific ()
 Set format to scientific. More...
 
formatw (int w)
 Set width to w characters. More...
 
formatwidth (int w)
 Set width to w characters. More...
 
formatwp (int w, int p)
 Set both width and precision. More...
 

Private Attributes

int form
 
int prec
 precision in char More...
 
int wide
 0=general,1=float,2=scientific, default is 1 More...
 

Friends

std::ostream & operator<< (std::ostream &os, const format &f)
 ostream operator for format More...
 

Constructor & Destructor Documentation

◆ format()

gnsstk::format::format ( int  w,
int  p,
int  f = 1 
)
inlineexplicit

Constructor.

Definition at line 59 of file format.hpp.

Member Function Documentation

◆ fix()

format& gnsstk::format::fix ( )
inline

Set format to fixed.

Definition at line 83 of file format.hpp.

◆ fixed()

format& gnsstk::format::fixed ( )
inline

Set format to fixed.

Definition at line 76 of file format.hpp.

◆ gen()

format& gnsstk::format::gen ( )
inline

Set format to general.

Definition at line 97 of file format.hpp.

◆ general()

format& gnsstk::format::general ( )
inline

Set format to general.

Definition at line 90 of file format.hpp.

◆ p()

format& gnsstk::format::p ( int  p)
inline

Set precision to p digits.

Definition at line 125 of file format.hpp.

◆ precision()

format& gnsstk::format::precision ( int  p)
inline

Set precision to p digits.

Definition at line 118 of file format.hpp.

◆ sci()

format& gnsstk::format::sci ( )
inline

Set format to scientific.

Definition at line 69 of file format.hpp.

◆ scientific()

format& gnsstk::format::scientific ( )
inline

Set format to scientific.

Definition at line 62 of file format.hpp.

◆ w()

format& gnsstk::format::w ( int  w)
inline

Set width to w characters.

Definition at line 111 of file format.hpp.

◆ width()

format& gnsstk::format::width ( int  w)
inline

Set width to w characters.

Definition at line 104 of file format.hpp.

◆ wp()

format& gnsstk::format::wp ( int  w,
int  p 
)
inline

Set both width and precision.

Definition at line 132 of file format.hpp.

Friends And Related Function Documentation

◆ operator<<

std::ostream& operator<< ( std::ostream &  os,
const format f 
)
friend

ostream operator for format

Member Data Documentation

◆ form

int gnsstk::format::form
private

Definition at line 53 of file format.hpp.

◆ prec

int gnsstk::format::prec
private

precision in char

Definition at line 55 of file format.hpp.

◆ wide

int gnsstk::format::wide
private

0=general,1=float,2=scientific, default is 1

width in char

Definition at line 54 of file format.hpp.


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


gnsstk
Author(s):
autogenerated on Wed Oct 25 2023 02:40:44