19 template <
class CharT,
class Traits>
23 ios.
setf(std::ios_base::left, std::ios_base::adjustfield);
30template <
class CharT,
class Traits,
class Allocator>
49 template <
class CharT,
class Traits>
53 os << std::basic_string<CharT, Traits>(d.
width, d.
fill);
61 explicit fpad(
int width_,
int pad_ = 0,
char fill_ =
' ') :
width(width_ + pad_),
fill(fill_)
66 template <
class CharT,
class Traits>
70 os << std::basic_string<CharT, Traits>(f.
width, f.
fill);
92template <
class CharT,
class Traits = std::
char_traits<CharT>,
class Allocator = std::allocator<CharT>>
105 template <
class CharT2,
class Traits2>
112 if (length < f.
width)
113 os << std::basic_string<CharT2, Traits2>(f.
width - length, CharT2(
' '));
119 if (length < f.
width)
120 os << std::basic_string<CharT2, Traits2>(f.
width - length, CharT2(
' '));
128template <
class CharT,
class Traits,
class Allocator>
129field_t<CharT, Traits, Allocator>
135template <
class CharT>
137field(CharT
const* text,
int width = 8,
int pad = 0,
bool right =
false)
145field(T
const& t,
int width = 8,
int pad = 0,
bool right =
false)
148 return field(text, width, pad, right);
151template <
class CharT,
class Traits,
class Allocator>
152field_t<CharT, Traits, Allocator>
158template <
class CharT>
160rField(CharT
const* text,
int width = 8,
int pad = 0)
168rField(T
const& t,
int width = 8,
int pad = 0)
171 return field(text, width, pad,
true);
Justifies a field at the specified width.
field_t(string_t const &text_, int width_, int pad_, bool right_)
friend std::basic_ostream< CharT2, Traits2 > & operator<<(std::basic_ostream< CharT2, Traits2 > &os, field_t< CharT, Traits, Allocator > const &f)
std::basic_string< CharT, Traits, Allocator > string_t
std::string to_string(T const &t)
field_t< CharT, Traits, Allocator > rField(std::basic_string< CharT, Traits, Allocator > const &text, int width=8, int pad=0)
field_t< CharT, Traits, Allocator > field(std::basic_string< CharT, Traits, Allocator > const &text, int width=8, int pad=0, bool right=false)
std::basic_string< CharT, Traits, Allocator > heading(std::basic_string< CharT, Traits, Allocator > title, int width=80, CharT fill=CharT('-'))
Produce a section heading and fill the rest of the line with dashes.
Produce a dashed line separator, with a specified or default size.
friend std::basic_ostream< CharT, Traits > & operator<<(std::basic_ostream< CharT, Traits > &os, divider const &d)
divider(int width_=80, CharT fill_=CharT('-'))
Creates a padded field with an optional fill character.
fpad(int width_, int pad_=0, char fill_=' ')
friend std::basic_ostream< CharT, Traits > & operator<<(std::basic_ostream< CharT, Traits > &os, fpad const &f)
Left justifies a field at the specified width.
friend std::basic_ios< CharT, Traits > & operator<<(std::basic_ios< CharT, Traits > &ios, leftw const &p)