1 #ifndef __JLANG_JMANIP__
2 #define __JLANG_JMANIP__
17 namespace JPP {
using namespace JLANG; }
28 static const int index = std::ios_base::xalloc();
186 inline std::ostream&
newline(std::ostream& out)
210 inline std::ostream&
tab(std::ostream& out)
222 inline std::ostream&
rewind(std::ostream& out)
224 return (out <<
'\r').flush();
254 return out << setw(format.
width);
288 return out << setw(format.width) << left;
320 return out << setw(format.width) << right;
338 const char fill =
' ') :
356 return out << setfill(format.
fill) << setw(format.
width);
405 const int w = this->width - os.str().size();
406 const char c = this->out.fill();
409 return this->out <<
FILL(
w/2) <<
' ' << os.str() <<
FILL((
w+1)/2) <<
' ' << setfill(c);
411 return this->out << os.str();
458 const char fill =
' ') :
461 this->precision = precision;
476 return out << fixed << right << setfill(format.
fill) << setw(format.
width) << setprecision(format.
precision);
496 const int precision) :
499 this->precision = precision;
514 return out << scientific << right << setw(format.
width) << setprecision(format.
precision);
548 const int precision = 0,
550 const char fill =
' ') :
552 precision(precision),
585 void get(std::ostream& out)
587 this->width = out.width();
588 this->precision = out.precision();
589 this->flags = out.flags();
590 this->fill = out.fill();
599 void put(std::ostream& out)
const
601 out.width (this->width);
602 out.precision(this->precision);
603 out.flags (this->flags);
604 out.fill (this->fill);
699 const JFormat_t& buffer = getFormat<T>();
716 getFormat<T>() = format;
bool getShortprint(std::ostream &out)
Get short print option.
int getPrintOption(std::ostream &out)
Get print option.
std::ostream & shortprint(std::ostream &out)
Set short printing.
bool getMediumprint(std::ostream &out)
Get medium print option.
bool getLongprint(std::ostream &out)
Get long print option.
std::ostream & mediumprint(std::ostream &out)
Set medium printing.
std::ostream & longprint(std::ostream &out)
Set long printing.
JFormat_t & getFormat()
Get format for given type.
void setPrintOption(std::ostream &out, const int option)
Set print option.
void setFormat(const JFormat_t &format)
Set format for given type.
std::ostream & newline(std::ostream &out)
Print newline character.
void setShortprint(std::ostream &out)
Set short print option.
std::ostream & tab(std::ostream &out)
Print tab character.
std::ostream & rewind(std::ostream &out)
Rewind character.
std::ostream & whitespace(std::ostream &out)
Print white space character.
void setLongprint(std::ostream &out)
Set long print option.
void setMediumprint(std::ostream &out)
Set medium print option.
const JPolynome f1(1.0, 2.0, 3.0)
Function.
Auxiliary classes and methods for language specific functionality.
int getIndex()
Get index for user I/O manipulation.
JPrintOption_t
Print options.
@ MEDIUM_PRINT
medium print
This name space includes all other name spaces (except KM3NETDAQ, KM3NET and ANTARES).
Auxiliary class for format center.
JCenter(std::ostream &out, const WIDTH &format)
Constructor.
std::ostream & operator<<(const T &value)
Write value to output stream.
Auxiliary data structure for alignment of data.
CENTER(const int width)
Constructor.
friend JCenter operator<<(std::ostream &out, const CENTER &format)
Format specifier.
Auxiliary data structure for sequence of same character.
FILL(const int width=0, const char fill=' ')
Constructor.
friend std::ostream & operator<<(std::ostream &out, const FILL &format)
Format specifier.
Auxiliary data structure for floating point format specification.
FIXED(const int width, const int precision, const char fill=' ')
Constructor.
friend std::ostream & operator<<(std::ostream &out, const FIXED &format)
Format specifier.
Auxiliary data structure to convert (lambda) function to printable object.
std::function< void(std::ostream &)> function_type
Type definition of print function.
friend std::ostream & operator<<(std::ostream &out, const LAMBDA &object)
Write printable object to output stream.
LAMBDA(const function_type &f1)
Constructor.
friend std::ostream & operator<<(std::ostream &out, const LEFT &format)
Format specifier.
LEFT(const int width)
Constructor.
RIGHT(const int width)
Constructor.
friend std::ostream & operator<<(std::ostream &out, const RIGHT &format)
Format specifier.
Auxiliary data structure for floating point format specification.
SCIENTIFIC(const int width, const int precision)
Constructor.
friend std::ostream & operator<<(std::ostream &out, const SCIENTIFIC &format)
Format specifier.
Auxiliary data structure for alignment of data.
WIDTH(const int width)
Constructor.
friend std::ostream & operator<<(std::ostream &out, const WIDTH &format)
Format specifier.