Added truncate flag (issue #1297)

This commit is contained in:
gabime
2019-11-14 12:28:23 +02:00
parent 1f5f17622e
commit cee35f7d24
3 changed files with 95 additions and 21 deletions

View File

@@ -29,17 +29,21 @@ struct padding_info
};
padding_info() = default;
padding_info(size_t width, padding_info::pad_side side)
padding_info(size_t width, padding_info::pad_side side, bool truncate)
: width_(width)
, side_(side)
, truncate_(truncate)
, enabled_(true)
{}
bool enabled() const
{
return width_ != 0;
return enabled_;
}
const size_t width_ = 0;
const pad_side side_ = left;
bool truncate_ = false;
bool enabled_ = false;
};
class flag_formatter