Lines Matching refs:Flag
46 struct Flag;
47 Flag* FindFlagByPointer(const void* ptr);
48 Flag* FindFlagByName(const char* name);
53 struct Flag {
282 "Flag --%s: value implied by --%s conflicts with explicit "
287 "Flag --%s is implied by --%s but also specified "
379 Flag flags[] = {
395 Flag* FindFlagByName(const char* name) {
402 Flag* FindFlagByPointer(const void* ptr) {
411 static const char* Type2String(Flag::FlagType type) {
413 case Flag::TYPE_BOOL:
415 case Flag::TYPE_MAYBE_BOOL:
417 case Flag::TYPE_INT:
419 case Flag::TYPE_UINT:
421 case Flag::TYPE_UINT64:
423 case Flag::TYPE_FLOAT:
425 case Flag::TYPE_SIZE_T:
427 case Flag::TYPE_STRING:
433 // Helper struct for printing normalize Flag names.
435 explicit FlagName(const Flag& flag) : flag(flag) {}
436 const Flag& flag;
448 explicit FlagValue(const Flag& flag) : flag(flag) {}
449 const Flag& flag;
453 const Flag& flag = flag_value.flag;
455 case Flag::TYPE_BOOL:
458 case Flag::TYPE_MAYBE_BOOL:
463 case Flag::TYPE_INT:
466 case Flag::TYPE_UINT:
469 case Flag::TYPE_UINT64:
472 case Flag::TYPE_FLOAT:
475 case Flag::TYPE_SIZE_T:
478 case Flag::TYPE_STRING: {
487 std::ostream& operator<<(std::ostream& os, const Flag& flag) {
488 if (flag.type() == Flag::TYPE_BOOL) {
504 for (const Flag& flag : flags) {
567 bool TryParseUnsigned(Flag* flag, const char* arg, const char* value,
604 Flag* flag = FindFlagByName(name);
620 if (flag->type() != Flag::TYPE_BOOL &&
621 flag->type() != Flag::TYPE_MAYBE_BOOL && value == nullptr) {
636 case Flag::TYPE_BOOL:
637 flag->set_bool_variable(!negated, Flag::SetBy::kCommandLine);
639 case Flag::TYPE_MAYBE_BOOL:
641 Flag::SetBy::kCommandLine);
643 case Flag::TYPE_INT:
645 Flag::SetBy::kCommandLine);
647 case Flag::TYPE_UINT: {
650 flag->set_uint_variable(parsed_value, Flag::SetBy::kCommandLine);
656 case Flag::TYPE_UINT64: {
659 flag->set_uint64_variable(parsed_value, Flag::SetBy::kCommandLine);
665 case Flag::TYPE_FLOAT:
667 Flag::SetBy::kCommandLine);
669 case Flag::TYPE_SIZE_T: {
672 flag->set_size_t_variable(parsed_value, Flag::SetBy::kCommandLine);
678 case Flag::TYPE_STRING:
680 Flag::SetBy::kCommandLine);
685 bool is_bool_type = flag->type() == Flag::TYPE_BOOL ||
686 flag->type() == Flag::TYPE_MAYBE_BOOL;
807 for (const Flag& f : flags) {
817 for (const Flag& f : flags) {
829 Flag* conclusion_flag = FindFlagByPointer(conclusion_pointer);
831 weak_implication ? Flag::SetBy::kWeakImplication
832 : Flag::SetBy::kImplication,