Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-01-30 09:31:43

0001 //
0002 // Copyright 2020 The Abseil Authors.
0003 //
0004 // Licensed under the Apache License, Version 2.0 (the "License");
0005 // you may not use this file except in compliance with the License.
0006 // You may obtain a copy of the License at
0007 //
0008 //      https://www.apache.org/licenses/LICENSE-2.0
0009 //
0010 // Unless required by applicable law or agreed to in writing, software
0011 // distributed under the License is distributed on an "AS IS" BASIS,
0012 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
0013 // See the License for the specific language governing permissions and
0014 // limitations under the License.
0015 
0016 #ifndef ABSL_FLAGS_INTERNAL_PRIVATE_HANDLE_ACCESSOR_H_
0017 #define ABSL_FLAGS_INTERNAL_PRIVATE_HANDLE_ACCESSOR_H_
0018 
0019 #include <memory>
0020 #include <string>
0021 
0022 #include "absl/base/config.h"
0023 #include "absl/flags/commandlineflag.h"
0024 #include "absl/flags/internal/commandlineflag.h"
0025 #include "absl/strings/string_view.h"
0026 
0027 namespace absl {
0028 ABSL_NAMESPACE_BEGIN
0029 namespace flags_internal {
0030 
0031 // This class serves as a trampoline to access private methods of
0032 // CommandLineFlag. This class is intended for use exclusively internally inside
0033 // of the Abseil Flags implementation.
0034 class PrivateHandleAccessor {
0035  public:
0036   // Access to CommandLineFlag::TypeId.
0037   static FlagFastTypeId TypeId(const CommandLineFlag& flag);
0038 
0039   // Access to CommandLineFlag::SaveState.
0040   static std::unique_ptr<FlagStateInterface> SaveState(CommandLineFlag& flag);
0041 
0042   // Access to CommandLineFlag::IsSpecifiedOnCommandLine.
0043   static bool IsSpecifiedOnCommandLine(const CommandLineFlag& flag);
0044 
0045   // Access to CommandLineFlag::ValidateInputValue.
0046   static bool ValidateInputValue(const CommandLineFlag& flag,
0047                                  absl::string_view value);
0048 
0049   // Access to CommandLineFlag::CheckDefaultValueParsingRoundtrip.
0050   static void CheckDefaultValueParsingRoundtrip(const CommandLineFlag& flag);
0051 
0052   static bool ParseFrom(CommandLineFlag& flag, absl::string_view value,
0053                         flags_internal::FlagSettingMode set_mode,
0054                         flags_internal::ValueSource source, std::string& error);
0055 };
0056 
0057 }  // namespace flags_internal
0058 ABSL_NAMESPACE_END
0059 }  // namespace absl
0060 
0061 #endif  // ABSL_FLAGS_INTERNAL_PRIVATE_HANDLE_ACCESSOR_H_