Export of internal Abseil changes
-- ea0cfebeb69b25bec343652bbe1a203f5476c51a by Mark Barolak <mbar@google.com>: Change "std::string" to "string" in places where a "std::" qualification was incorrectly inserted by automation. PiperOrigin-RevId: 300108520 GitOrigin-RevId: ea0cfebeb69b25bec343652bbe1a203f5476c51a Change-Id: Ie3621e63a6ebad67b9fe56a3ebe33e1d50dac602
This commit is contained in:
parent
d936052d32
commit
a877af1f29
68 changed files with 191 additions and 191 deletions
|
|
@ -141,7 +141,7 @@ class CommandLineFlag {
|
|||
// Returns name of the file where this flag is defined.
|
||||
virtual std::string Filename() const = 0;
|
||||
// Returns name of the flag's value type for some built-in types or empty
|
||||
// std::string.
|
||||
// string.
|
||||
virtual absl::string_view Typename() const = 0;
|
||||
// Returns help message associated with this flag.
|
||||
virtual std::string Help() const = 0;
|
||||
|
|
@ -163,7 +163,7 @@ class CommandLineFlag {
|
|||
// or nullptr if flag does not support saving and restoring a state.
|
||||
virtual std::unique_ptr<FlagStateInterface> SaveState() = 0;
|
||||
|
||||
// Sets the value of the flag based on specified std::string `value`. If the flag
|
||||
// Sets the value of the flag based on specified string `value`. If the flag
|
||||
// was successfully set to new value, it returns true. Otherwise, sets `error`
|
||||
// to indicate the error, leaves the flag unchanged, and returns false. There
|
||||
// are three ways to set the flag's value:
|
||||
|
|
@ -176,7 +176,7 @@ class CommandLineFlag {
|
|||
flags_internal::ValueSource source,
|
||||
std::string* error) = 0;
|
||||
|
||||
// Checks that flags default value can be converted to std::string and back to the
|
||||
// Checks that flags default value can be converted to string and back to the
|
||||
// flag's value type.
|
||||
virtual void CheckDefaultValueParsingRoundtrip() const = 0;
|
||||
|
||||
|
|
|
|||
|
|
@ -408,7 +408,7 @@ void FlagImpl::CheckDefaultValueParsingRoundtrip() const {
|
|||
ABSL_INTERNAL_LOG(
|
||||
FATAL,
|
||||
absl::StrCat("Flag ", Name(), " (from ", Filename(),
|
||||
"): std::string form of default value '", v,
|
||||
"): string form of default value '", v,
|
||||
"' could not be parsed; error=", error));
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -439,7 +439,7 @@ class FlagImpl {
|
|||
ABSL_EXCLUSIVE_LOCKS_REQUIRED(*DataGuard());
|
||||
// Flag initialization called via absl::call_once.
|
||||
void Init();
|
||||
// Attempts to parse supplied `value` std::string. If parsing is successful,
|
||||
// Attempts to parse supplied `value` string. If parsing is successful,
|
||||
// returns new value. Otherwise returns nullptr.
|
||||
std::unique_ptr<void, DynValueDeleter> TryParse(absl::string_view value,
|
||||
std::string* err) const
|
||||
|
|
|
|||
|
|
@ -134,14 +134,14 @@ class FlagHelpPrettyPrinter {
|
|||
first_line_(true) {}
|
||||
|
||||
void Write(absl::string_view str, bool wrap_line = false) {
|
||||
// Empty std::string - do nothing.
|
||||
// Empty string - do nothing.
|
||||
if (str.empty()) return;
|
||||
|
||||
std::vector<absl::string_view> tokens;
|
||||
if (wrap_line) {
|
||||
for (auto line : absl::StrSplit(str, absl::ByAnyChar("\n\r"))) {
|
||||
if (!tokens.empty()) {
|
||||
// Keep line separators in the input std::string.
|
||||
// Keep line separators in the input string.
|
||||
tokens.push_back("\n");
|
||||
}
|
||||
for (auto token :
|
||||
|
|
@ -156,13 +156,13 @@ class FlagHelpPrettyPrinter {
|
|||
for (auto token : tokens) {
|
||||
bool new_line = (line_len_ == 0);
|
||||
|
||||
// Respect line separators in the input std::string.
|
||||
// Respect line separators in the input string.
|
||||
if (token == "\n") {
|
||||
EndLine();
|
||||
continue;
|
||||
}
|
||||
|
||||
// Write the token, ending the std::string first if necessary/possible.
|
||||
// Write the token, ending the string first if necessary/possible.
|
||||
if (!new_line && (line_len_ + token.size() >= max_line_len_)) {
|
||||
EndLine();
|
||||
new_line = true;
|
||||
|
|
|
|||
|
|
@ -172,7 +172,7 @@ std::string Unparse(long long v) { return absl::StrCat(v); }
|
|||
std::string Unparse(unsigned long long v) { return absl::StrCat(v); }
|
||||
template <typename T>
|
||||
std::string UnparseFloatingPointVal(T v) {
|
||||
// digits10 is guaranteed to roundtrip correctly in std::string -> value -> std::string
|
||||
// digits10 is guaranteed to roundtrip correctly in string -> value -> string
|
||||
// conversions, but may not be enough to represent all the values correctly.
|
||||
std::string digit10_str =
|
||||
absl::StrFormat("%.*g", std::numeric_limits<T>::digits10, v);
|
||||
|
|
|
|||
|
|
@ -533,10 +533,10 @@ std::tuple<bool, absl::string_view> DeduceFlagValue(const CommandLineFlag& flag,
|
|||
curr_list->PopFront();
|
||||
value = curr_list->Front();
|
||||
|
||||
// Heuristic to detect the case where someone treats a std::string arg
|
||||
// Heuristic to detect the case where someone treats a string arg
|
||||
// like a bool or just forgets to pass a value:
|
||||
// --my_string_var --foo=bar
|
||||
// We look for a flag of std::string type, whose value begins with a
|
||||
// We look for a flag of string type, whose value begins with a
|
||||
// dash and corresponds to known flag or standalone --.
|
||||
if (!value.empty() && value[0] == '-' && flag.IsOfType<std::string>()) {
|
||||
auto maybe_flag_name = std::get<0>(SplitNameAndValue(value.substr(1)));
|
||||
|
|
@ -646,7 +646,7 @@ std::vector<char*> ParseCommandLineImpl(int argc, char* argv[],
|
|||
|
||||
// 60. Split the current argument on '=' to figure out the argument
|
||||
// name and value. If flag name is empty it means we've got "--". value
|
||||
// can be empty either if there were no '=' in argument std::string at all or
|
||||
// can be empty either if there were no '=' in argument string at all or
|
||||
// an argument looked like "--foo=". In a latter case is_empty_value is
|
||||
// true.
|
||||
absl::string_view flag_name;
|
||||
|
|
|
|||
|
|
@ -90,7 +90,7 @@ struct FlagsUsageConfig {
|
|||
// program output.
|
||||
flags_internal::FlagKindFilter contains_helppackage_flags;
|
||||
|
||||
// Generates std::string containing program version. This is the std::string reported
|
||||
// Generates string containing program version. This is the string reported
|
||||
// when user specifies --version in a command line.
|
||||
std::function<std::string()> version_string;
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue