tvl-depot/absl/flags/internal/commandlineflag.cc
Abseil Team bd317cae3b Export of internal Abseil changes
--
0b3113ff8d252be11c35d8a77cdb23cc03e993d2 by Benjamin Barenblat <bbaren@google.com>:

Correct Apache license headers

These files have always been licensed under the Apache license (per the
repository LICENSE), but they lacked headers to locally indicate that
fact. Add the appropriate headers.

PiperOrigin-RevId: 310223650

--
4f92b0819781279c02b48bcfce4c10d547e35a49 by Greg Falcon <gfalcon@google.com>:

Internal change

PiperOrigin-RevId: 310223203

--
378cab69ce3290d20b48d839daa988c3e63ed031 by Matthew Brown <matthewbr@google.com>:

Internal Change

PiperOrigin-RevId: 310180198

--
93a1851be0f3726f7435cef56afaa1b8664f40e7 by Gennadiy Rozental <rogeeff@google.com>:

Internal change

PiperOrigin-RevId: 310003669

--
fbee3221cb1f8717fdf34e1cc0ea248a7719227a by Gennadiy Rozental <rogeeff@google.com>:

Make 4 argument version of ParseFrom interface private in CommandLineFlag. Instroduce 2 argument version of this interface.

PiperOrigin-RevId: 309995363
GitOrigin-RevId: 0b3113ff8d252be11c35d8a77cdb23cc03e993d2
Change-Id: Ibfdf948d3d081f5630ce7ebff992ab85c75cecba
2020-05-06 17:14:07 -04:00

61 lines
2 KiB
C++

//
// Copyright 2020 The Abseil Authors.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// https://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
#include "absl/flags/internal/commandlineflag.h"
namespace absl {
ABSL_NAMESPACE_BEGIN
namespace flags_internal {
FlagStateInterface::~FlagStateInterface() {}
bool CommandLineFlag::IsRetired() const { return false; }
bool CommandLineFlag::ParseFrom(absl::string_view value, std::string* error) {
return ParseFrom(value, flags_internal::SET_FLAGS_VALUE,
flags_internal::kProgrammaticChange, error);
}
FlagFastTypeId PrivateHandleInterface::TypeId(const CommandLineFlag& flag) {
return flag.TypeId();
}
std::unique_ptr<FlagStateInterface> PrivateHandleInterface::SaveState(
CommandLineFlag* flag) {
return flag->SaveState();
}
bool PrivateHandleInterface::ValidateInputValue(const CommandLineFlag& flag,
absl::string_view value) {
return flag.ValidateInputValue(value);
}
void PrivateHandleInterface::CheckDefaultValueParsingRoundtrip(
const CommandLineFlag& flag) {
flag.CheckDefaultValueParsingRoundtrip();
}
bool PrivateHandleInterface::ParseFrom(CommandLineFlag* flag,
absl::string_view value,
flags_internal::FlagSettingMode set_mode,
flags_internal::ValueSource source,
std::string* error) {
return flag->ParseFrom(value, set_mode, source, error);
}
} // namespace flags_internal
ABSL_NAMESPACE_END
} // namespace absl