1 #ifndef __JEEP__JPRINT__
2 #define __JEEP__JPRINT__
17 namespace JPP {
using namespace JEEP; }
28 static const int index = std::ios_base::xalloc();
53 static std::ostringstream buffer;
203 inline std::ostream&
newline(std::ostream& out)
227 inline std::ostream&
tab(std::ostream& out)
239 inline std::ostream&
rewind(std::ostream& out)
241 return (out <<
'\r').flush();
270 return out << setw(format.
width);
303 return out << setw(format.width) << left;
334 return out << setw(format.width) << right;
352 const char fill =
' ') :
369 const char c = out.fill();
371 return out << setfill(format.
fill) << setw(format.
width) << format.
fill << setfill(c);
420 const int w = this->width - os.str().size();
421 const char c = this->out.fill();
424 return this->out <<
FILL(w/2) << os.str() <<
FILL((w+1)/2) << setfill(c);
426 return this->out << os.str();
471 const int precision) :
474 this->precision = precision;
488 return out << fixed << right << setw(format.
width) << setprecision(format.
precision);
508 const int precision) :
511 this->precision = precision;
525 return out << scientific << right << setw(format.
width) << setprecision(format.
precision);
544 __flags = out.flags();
554 JFlags(std::ostream& out, std::ios::fmtflags flags) :
557 __flags = out.flags();
570 JFlags(std::ostream& out, std::ios::fmtflags flags, std::ios::fmtflags mask) :
573 __flags = out.flags();
575 out.setf(flags, mask);
586 __out.flags(__flags);
602 #define MAKE_STRING(A) (static_cast<std::ostringstream&>(JEEP::getOstream() << A)).str()
611 #define MAKE_CSTRING(A) MAKE_STRING(A).c_str()
RIGHT(const int width)
Constructor.
std::ostream & rewind(std::ostream &out)
Rewind character.
Auxiliary data structure for alignment of data.
JPrintOption_t
Print options.
friend std::ostream & operator<<(std::ostream &out, const WIDTH &format)
Format specifier.
void setMediumprint(std::ostream &out)
Set medium print option.
friend std::ostream & operator<<(std::ostream &out, const SCIENTIFIC &format)
Format specifier.
friend std::ostream & operator<<(std::ostream &out, const RIGHT &format)
Format specifier.
void setLongprint(std::ostream &out)
Set long print option.
void setShortprint(std::ostream &out)
Set short print option.
WIDTH(const int width)
Constructor.
std::ios::fmtflags __mask
std::ostream & whitespace(std::ostream &out)
Print white space character.
void setPrintOption(std::ostream &out, const int option)
Set print option.
Auxiliary data structure for floating point format specification.
friend std::ostream & operator<<(std::ostream &out, const FIXED &format)
Format specifier.
bool getLongprint(std::ostream &out)
Get long print option.
Auxiliary data structure for alignment of data.
std::ostream & newline(std::ostream &out)
Print newline character.
Auxiliary class for format center.
I/O coloring auxiliaries.
LEFT(const int width)
Constructor.
std::ostream & mediumprint(std::ostream &out)
Set medium printing.
int getIndex()
Get index for user I/O manipulation.
std::ostream & getOstream()
Get output stream for conversion to std::string or C-string.
bool getMediumprint(std::ostream &out)
Get medium print option.
JFlags(std::ostream &out, std::ios::fmtflags flags, std::ios::fmtflags mask)
Constructor.
Auxiliary data structure for sequence of same character.
friend std::ostream & operator<<(std::ostream &out, const LEFT &format)
Format specifier.
std::ios::fmtflags __flags
JFlags(std::ostream &out, std::ios::fmtflags flags)
Constructor.
std::ostream & longprint(std::ostream &out)
Set long printing.
SCIENTIFIC(const int width, const int precision)
Constructor.
JCenter(std::ostream &out, const WIDTH &format)
Constructor.
std::ostream & tab(std::ostream &out)
Print tab character.
FILL(const int width, const char fill= ' ')
Constructor.
int getPrintOption(std::ostream &out)
Get print option.
friend std::ostream & operator<<(std::ostream &out, const FILL &format)
Format specifier.
bool getShortprint(std::ostream &out)
Get short print option.
JFlags(std::ostream &out)
Constructor.
CENTER(const int width)
Constructor.
std::ostream & shortprint(std::ostream &out)
Set short printing.
FIXED(const int width, const int precision)
Constructor.
Auxiliary data structure for floating point format specification.
std::ostream & operator<<(const T &value)
Write value to output stream.
Auxiliary class to temporarily modify format specifications.
friend JCenter operator<<(std::ostream &out, const CENTER &format)
Format specifier.