class FormatCountCapture

Defined at line 153 of file ../../third_party/abseil-cpp/absl/strings/str_format.h

FormatCountCapture

This class provides a way to safely wrap `StrFormat()` captures of `%n`

conversions, which denote the number of characters written by a formatting

operation to this point, into an integer value.

This wrapper is designed to allow safe usage of `%n` within `StrFormat(); in

the `printf()` family of functions, `%n` is not safe to use, as the `int *`

buffer can be used to capture arbitrary data.

Example:

int n = 0;

std::string s = absl::StrFormat("%s%d%n", "hello", 123,

absl::FormatCountCapture(

&n

));

EXPECT_EQ(8, n);

Public Methods

void FormatCountCapture (absl::Nonnull<int *> p)

Defined at line 155 of file ../../third_party/abseil-cpp/absl/strings/str_format.h

Friends

class FormatCountCaptureHelper