diff options
Diffstat (limited to 'third_party/abseil_cpp/absl/flags/reflection.h')
-rw-r--r-- | third_party/abseil_cpp/absl/flags/reflection.h | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/third_party/abseil_cpp/absl/flags/reflection.h b/third_party/abseil_cpp/absl/flags/reflection.h index 045f9784e269..e6baf5de4b0c 100644 --- a/third_party/abseil_cpp/absl/flags/reflection.h +++ b/third_party/abseil_cpp/absl/flags/reflection.h @@ -26,6 +26,7 @@ #include <string> #include "absl/base/config.h" +#include "absl/container/flat_hash_map.h" #include "absl/flags/commandlineflag.h" #include "absl/flags/internal/commandlineflag.h" @@ -40,7 +41,11 @@ class FlagSaverImpl; // Returns the reflection handle of an Abseil flag of the specified name, or // `nullptr` if not found. This function will emit a warning if the name of a // 'retired' flag is specified. -CommandLineFlag* FindCommandLineFlag(absl::string_view name); +absl::CommandLineFlag* FindCommandLineFlag(absl::string_view name); + +// Returns current state of the Flags registry in a form of mapping from flag +// name to a flag reflection handle. +absl::flat_hash_map<absl::string_view, absl::CommandLineFlag*> GetAllFlags(); //------------------------------------------------------------------------------ // FlagSaver @@ -59,7 +64,7 @@ CommandLineFlag* FindCommandLineFlag(absl::string_view name); // void MyFunc() { // absl::FlagSaver fs; // ... -// absl::SetFlag(FLAGS_myFlag, otherValue); +// absl::SetFlag(&FLAGS_myFlag, otherValue); // ... // } // scope of FlagSaver left, flags return to previous state // |