Lines Matching refs:value

139 Result<bool> ParseBool(const std::string& value, const std::string& name) {  in ParseBool()  argument
140 auto result = android::base::ParseBool(value); in ParseBool()
142 "Failed to parse value \"" << value << "\" for " << name); in ParseBool()
300 auto value = getter_ ? XmlEscape((*getter_)()) : std::string{""}; in WriteGflagsCompatXml()
301 out << " <default>" << value << "</default>\n"; in WriteGflagsCompatXml()
302 out << " <current>" << value << "</current>\n"; in WriteGflagsCompatXml()
414 Flag VerbosityFlag(android::base::LogSeverity& value) { in VerbosityFlag() argument
416 .Getter([&value]() { return FromSeverity(value); }) in VerbosityFlag()
417 .Setter([&value](const FlagMatch& match) -> Result<void> { in VerbosityFlag()
418 value = CF_EXPECT(ToSeverity(match.value)); in VerbosityFlag()
441 bool& value, in GflagsCompatBoolFlagSetter() argument
445 value = true; in GflagsCompatBoolFlagSetter()
448 value = false; in GflagsCompatBoolFlagSetter()
451 if (match.value == "true") { in GflagsCompatBoolFlagSetter()
452 value = true; in GflagsCompatBoolFlagSetter()
454 } else if (match.value == "false") { in GflagsCompatBoolFlagSetter()
455 value = false; in GflagsCompatBoolFlagSetter()
458 return CF_ERRF("Unexpected boolean value \"{}\" for \{}\"", match.value, in GflagsCompatBoolFlagSetter()
475 Flag HelpXmlFlag(const std::vector<Flag>& flags, std::ostream& out, bool& value, in HelpXmlFlag() argument
478 auto setter = [name, &out, &value, text, in HelpXmlFlag()
488 value = print_xml; in HelpXmlFlag()
504 return CF_ERRF("Unknown flag \"{}\"", match.value); in InvalidFlagGuard()
515 return CF_ERRF("Unexpected argument \"{}\"", match.value); in UnexpectedArgumentGuard()
527 Flag GflagsCompatFlag(const std::string& name, std::string& value) { in GflagsCompatFlag() argument
529 .Getter([&value]() { return value; }) in GflagsCompatFlag()
530 .Setter([&value](const FlagMatch& match) -> Result<void> { in GflagsCompatFlag()
531 value = match.value; in GflagsCompatFlag()
537 std::optional<T> ParseInteger(const std::string& value) { in ParseInteger() argument
538 if (value.size() == 0) { in ParseInteger()
541 const char* base = value.c_str(); in ParseInteger()
545 if (errno != 0 || end != base + value.size()) { in ParseInteger()
555 static Flag GflagsCompatNumericFlagGeneric(const std::string& name, T& value) { in GflagsCompatNumericFlagGeneric() argument
557 .Getter([&value]() { return std::to_string(value); }) in GflagsCompatNumericFlagGeneric()
558 .Setter([&value](const FlagMatch& match) -> Result<void> { in GflagsCompatNumericFlagGeneric()
559 value = CF_EXPECTF(ParseInteger<T>(match.value), in GflagsCompatNumericFlagGeneric()
560 "Failed to parse \"{}\" as an integer", match.value); in GflagsCompatNumericFlagGeneric()
565 Flag GflagsCompatFlag(const std::string& name, int32_t& value) { in GflagsCompatFlag() argument
566 return GflagsCompatNumericFlagGeneric(name, value); in GflagsCompatFlag()
569 Flag GflagsCompatFlag(const std::string& name, bool& value) { in GflagsCompatFlag() argument
571 .Getter([&value]() { return fmt::format("{}", value); }) in GflagsCompatFlag()
572 .Setter([name, &value](const FlagMatch& match) { in GflagsCompatFlag()
573 return GflagsCompatBoolFlagSetter(name, value, match); in GflagsCompatFlag()
578 std::vector<std::string>& value) { in GflagsCompatFlag() argument
580 .Getter([&value]() { return android::base::Join(value, ','); }) in GflagsCompatFlag()
581 .Setter([&value](const FlagMatch& match) -> Result<void> { in GflagsCompatFlag()
582 if (match.value.empty()) { in GflagsCompatFlag()
583 value.clear(); in GflagsCompatFlag()
587 android::base::Split(match.value, ","); in GflagsCompatFlag()
588 value = std::move(str_vals); in GflagsCompatFlag()
593 Flag GflagsCompatFlag(const std::string& name, std::vector<bool>& value, in GflagsCompatFlag() argument
596 .Getter([&value]() { return fmt::format("{}", fmt::join(value, ",")); }) in GflagsCompatFlag()
597 .Setter([&name, &value, def_val](const FlagMatch& match) -> Result<void> { in GflagsCompatFlag()
598 if (match.value.empty()) { in GflagsCompatFlag()
599 value.clear(); in GflagsCompatFlag()
603 android::base::Split(match.value, ","); in GflagsCompatFlag()
604 value.clear(); in GflagsCompatFlag()
614 value = output_vals; in GflagsCompatFlag()