1 #ifndef __JEEP__JPRINT__
2 #define __JEEP__JPRINT__
18 namespace JPP {
using namespace JEEP; }
29 static const int index = std::ios_base::xalloc();
54 static std::ostringstream buffer;
72 static std::string buffer;
76 return buffer.c_str();
222 inline std::ostream&
newline(std::ostream& out)
246 inline std::ostream&
tab(std::ostream& out)
258 inline std::ostream&
rewind(std::ostream& out)
260 return (out <<
'\r').flush();
289 return out << setw(format.
width);
322 return out << setw(format.width) << left;
353 return out << setw(format.width) << right;
371 const char fill =
' ') :
391 return out << setfill(format.
fill) << setw(format.
width);
440 const int w = this->width - os.str().size();
441 const char c = this->out.fill();
444 return this->out <<
FILL(
w/2) <<
' ' << os.str() <<
FILL((
w+1)/2) <<
' ' << setfill(c);
446 return this->out << os.str();
491 const int precision) :
494 this->precision = precision;
508 return out << fixed << right << setw(format.
width) << setprecision(format.
precision);
528 const int precision) :
531 this->precision = precision;
545 return out << scientific << right << setw(format.
width) << setprecision(format.
precision);
626 __flags = out.flags();
636 JFlags(std::ostream& out, std::ios::fmtflags flags) :
639 __flags = out.flags();
652 JFlags(std::ostream& out, std::ios::fmtflags flags, std::ios::fmtflags mask) :
655 __flags = out.flags();
657 out.setf(flags, mask);
668 __out.flags(__flags);
690 #define VARGS_STRING(A, B, ...) MAKE_STRING(B)
699 #define MAKE_STRING(A) (static_cast<std::ostringstream&>(JEEP::getOstream() << A)).str()
708 #define MAKE_CSTRING(A) JEEP::getCString(MAKE_STRING(A))
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 JStream operator<<(std::ostream &out, const JEEPZ &format)
Format specifier.
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.
const char * getCString(const std::string &input)
Get output C-string.
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.
JEEPZ()
Default constructor.
LEFT(const int width)
Constructor.
std::ostream & operator<<(const T &value)
Write value to output stream.
do set_variable OUTPUT_DIRECTORY $WORKDIR T
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.
Auxiliary data structure for streaming of STL containers.
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.
int getPrintOption(std::ostream &out)
Get print option.
friend std::ostream & operator<<(std::ostream &out, const FILL &format)
Format specifier.
FILL(const int width=0, const char fill= ' ')
Constructor.
bool getShortprint(std::ostream &out)
Get short print option.
JStream(std::ostream &out)
Constructor.
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 for format STL containers.
Auxiliary class to temporarily modify format specifications.
friend JCenter operator<<(std::ostream &out, const CENTER &format)
Format specifier.
std::ostream & writeObject(std::ostream &out, const T &object)
Stream output of object.