summaryrefslogtreecommitdiff
path: root/absl/flags/marshalling.h
diff options
context:
space:
mode:
Diffstat (limited to 'absl/flags/marshalling.h')
-rw-r--r--absl/flags/marshalling.h21
1 files changed, 15 insertions, 6 deletions
diff --git a/absl/flags/marshalling.h b/absl/flags/marshalling.h
index 5598d444..0b503354 100644
--- a/absl/flags/marshalling.h
+++ b/absl/flags/marshalling.h
@@ -33,15 +33,16 @@
// * `double`
// * `std::string`
// * `std::vector<std::string>`
+// * `absl::LogSeverity` (provided natively for layering reasons)
//
// Note that support for integral types is implemented using overloads for
// variable-width fundamental types (`short`, `int`, `long`, etc.). However,
// you should prefer the fixed-width integral types (`int32_t`, `uint64_t`,
// etc.) we've noted above within flag definitions.
-
//
// In addition, several Abseil libraries provide their own custom support for
-// Abseil flags.
+// Abseil flags. Documentation for these formats is provided in the type's
+// `AbslParseFlag()` definition.
//
// The Abseil time library provides the following support for civil time values:
//
@@ -164,10 +165,11 @@
#include <string>
#include <vector>
+#include "absl/base/config.h"
#include "absl/strings/string_view.h"
namespace absl {
-inline namespace lts_2019_08_08 {
+ABSL_NAMESPACE_BEGIN
namespace flags_internal {
// Overloads of `AbslParseFlag()` and `AbslUnparseFlag()` for fundamental types.
@@ -179,8 +181,8 @@ bool AbslParseFlag(absl::string_view, unsigned int*, std::string*); // NOLINT
bool AbslParseFlag(absl::string_view, long*, std::string*); // NOLINT
bool AbslParseFlag(absl::string_view, unsigned long*, std::string*); // NOLINT
bool AbslParseFlag(absl::string_view, long long*, std::string*); // NOLINT
-bool AbslParseFlag(absl::string_view, unsigned long long*,
- std::string*); // NOLINT
+bool AbslParseFlag(absl::string_view, unsigned long long*, // NOLINT
+ std::string*);
bool AbslParseFlag(absl::string_view, float*, std::string*);
bool AbslParseFlag(absl::string_view, double*, std::string*);
bool AbslParseFlag(absl::string_view, std::string*, std::string*);
@@ -249,7 +251,14 @@ inline std::string UnparseFlag(const T& v) {
return flags_internal::Unparse(v);
}
-} // inline namespace lts_2019_08_08
+// Overloads for `absl::LogSeverity` can't (easily) appear alongside that type's
+// definition because it is layered below flags. See proper documentation in
+// base/log_severity.h.
+enum class LogSeverity : int;
+bool AbslParseFlag(absl::string_view, absl::LogSeverity*, std::string*);
+std::string AbslUnparseFlag(absl::LogSeverity);
+
+ABSL_NAMESPACE_END
} // namespace absl
#endif // ABSL_FLAGS_MARSHALLING_H_