summaryrefslogtreecommitdiff
path: root/absl/strings/internal/str_format/extension.h
diff options
context:
space:
mode:
authorGravatar Abseil Team <absl-team@google.com>2022-09-15 14:29:39 -0700
committerGravatar Copybara-Service <copybara-worker@google.com>2022-09-15 14:30:34 -0700
commitab2e2c4f6062999afaf960759dfccb77f350c702 (patch)
treea09ca81723521190744e2ec917a9f697cd08254b /absl/strings/internal/str_format/extension.h
parentd423ac0ef052bd7b6fc53fd1a026a44e1713d993 (diff)
Adds support for "%v" in absl::StrFormat and related functions for numeric types, including integer and floating point values. Users may now specify %v and have the format specifier deduced. Integer values will print according to %d specifications, unsigned values will use %u, and floating point values will use %g. Note that %v does not work for `char` due to ambiguity regarding the intended output. Please continue to use %c for `char`.
PiperOrigin-RevId: 474658166 Change-Id: Iecae39263e368b27232db440535f2bf7da8d863c
Diffstat (limited to 'absl/strings/internal/str_format/extension.h')
-rw-r--r--absl/strings/internal/str_format/extension.h2
1 files changed, 2 insertions, 0 deletions
diff --git a/absl/strings/internal/str_format/extension.h b/absl/strings/internal/str_format/extension.h
index f8d98bf7..603bd49d 100644
--- a/absl/strings/internal/str_format/extension.h
+++ b/absl/strings/internal/str_format/extension.h
@@ -292,6 +292,8 @@ class FormatConversionSpecImpl {
return conv_;
}
+ void set_conversion_char(FormatConversionChar c) { conv_ = c; }
+
// Returns the specified width. If width is unspecfied, it returns a negative
// value.
int width() const { return width_; }