BAN: Add support for string format padding
This commit is contained in:
parent
0964c9f928
commit
1fc2e43881
|
|
@ -352,10 +352,9 @@ namespace BAN::Formatter
|
|||
{
|
||||
|
||||
template<typename F>
|
||||
void print_argument(F putc, const String& string, const ValueFormat&)
|
||||
void print_argument(F putc, const String& string, const ValueFormat& format)
|
||||
{
|
||||
for (String::size_type i = 0; i < string.size(); i++)
|
||||
putc(string[i]);
|
||||
print_argument(putc, string.sv(), format);
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -246,10 +246,12 @@ namespace BAN::Formatter
|
|||
{
|
||||
|
||||
template<typename F>
|
||||
void print_argument(F putc, const StringView& sv, const ValueFormat&)
|
||||
void print_argument(F putc, const StringView& sv, const ValueFormat& format)
|
||||
{
|
||||
for (StringView::size_type i = 0; i < sv.size(); i++)
|
||||
putc(sv[i]);
|
||||
for (int i = sv.size(); i < format.fill; i++)
|
||||
putc(' ');
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue