diff options
author | Abseil Team <absl-team@google.com> | 2023-06-12 12:13:38 -0700 |
---|---|---|
committer | Copybara-Service <copybara-worker@google.com> | 2023-06-12 12:14:13 -0700 |
commit | 5d1f1cf9dd9455b9ff41fa3e6009f9c40feaf2f2 (patch) | |
tree | 7f51e14b15bbc111f495a144357e97b4727e95ef /absl/flags/marshalling.cc | |
parent | a3d9a943253f596bd88538f18cc6b07aaba6d3c0 (diff) |
Adding more support and testing for int128 and uint128 flags from cl/534444213
PiperOrigin-RevId: 539726003
Change-Id: Ie38f8d48a7b4c9d498fc1c4c4af6138048f80f68
Diffstat (limited to 'absl/flags/marshalling.cc')
-rw-r--r-- | absl/flags/marshalling.cc | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/absl/flags/marshalling.cc b/absl/flags/marshalling.cc index cf6312b1..50b7b331 100644 --- a/absl/flags/marshalling.cc +++ b/absl/flags/marshalling.cc @@ -19,6 +19,7 @@ #include <cmath> #include <limits> +#include <sstream> #include <string> #include <type_traits> #include <vector> @@ -198,6 +199,17 @@ std::string Unparse(long v) { return absl::StrCat(v); } std::string Unparse(unsigned long v) { return absl::StrCat(v); } std::string Unparse(long long v) { return absl::StrCat(v); } std::string Unparse(unsigned long long v) { return absl::StrCat(v); } +std::string Unparse(absl::int128 v) { + std::stringstream ss; + ss << v; + return ss.str(); +} +std::string Unparse(absl::uint128 v) { + std::stringstream ss; + ss << v; + return ss.str(); +} + template <typename T> std::string UnparseFloatingPointVal(T v) { // digits10 is guaranteed to roundtrip correctly in string -> value -> string |