absl::FormatSink::PutPaddedString

Appends precision number of bytes of v to the format sink.

Synopsis

Declared in <absl/strings/str_format.h>

bool
PutPaddedString(
    std::string_view v,
    int width,
    int precision,
    bool left);

Description

If this is less than width, spaces will be appended first (if left is false), or after (if left is true) to ensure the total amount appended is at least width.

Return Value

true on success.

Parameters

NameDescription
vThe characters to append.
widthThe minimum number of bytes to append.
precisionThe number of bytes of v to append.
leftWhether padding is added after (true) or before (false).