Lines Matching defs:value
36 // This function only looks for a '=', to split the flag name from the value for
55 flag.value() = true;
62 flag.value() = true;
66 const std::string value = raw_flag.substr(equal_index + 1);
67 if (value == "true") {
68 flag.value() = true;
72 if (value == "false") {
73 flag.value() = false;
80 // Parse a uint32_t flag value.
81 bool parse_flag_value(Flag<uint32_t>& flag, const std::string& value) {
83 if (!std::regex_match(value, unsigned_pattern)) {
84 std::cerr << "'" << value << "' is not a unsigned number." << std::endl;
90 const uint64_t number = strtoull(value.c_str(), &end_ptr, 10);
91 if (end_ptr == nullptr || end_ptr != value.c_str() + value.size() ||
93 std::cerr << "'" << value << "' is not a unsigned number." << std::endl;
98 std::cerr << "'" << value << "' cannot be represented as a 32bit unsigned."
103 flag.value() = static_cast<uint32_t>(number);
107 // "Parse" a string flag value (assigns it, cannot fail).
108 bool parse_flag_value(Flag<std::string>& flag, const std::string& value) {
109 flag.value() = value;