Auxiliary class for format center.
More...
#include <JManip.hh>
|
| JCenter (std::ostream &out, const WIDTH &format) |
| Constructor.
|
|
template<class T > |
std::ostream & | operator<< (const T &value) |
| Write value to output stream.
|
|
Auxiliary class for format center.
Definition at line 373 of file JManip.hh.
◆ JCenter()
CENTER::JCenter::JCenter |
( |
std::ostream & | out, |
|
|
const WIDTH & | format ) |
|
inline |
Constructor.
- Parameters
-
out | output stream |
format | format center |
Definition at line 382 of file JManip.hh.
◆ operator<<()
template<class T >
std::ostream & CENTER::JCenter::operator<< |
( |
const T & | value | ) |
|
|
inline |
Write value to output stream.
- Parameters
-
- Returns
- this JCenter
Definition at line 395 of file JManip.hh.
396 {
398
399 ostringstream os;
400
402
403 os << value;
404
405 const int w = this->
width - os.str().size();
406 const char c = this->
out.fill();
407
408 if (w > 0)
409 return this->
out <<
FILL(w/2) <<
' ' << os.str() <<
FILL((w+1)/2) <<
' ' << setfill(c);
410 else
411 return this->
out << os.str();
412 }
Auxiliary data structure for sequence of same character.
◆ out
std::ostream& CENTER::JCenter::out |
|
private |
◆ width
The documentation for this struct was generated from the following file: