| // WARNING: This file is machine generated by fidlgen. |
| |
| // fidl_experiment = output_index_json |
| |
| #include <fidl/test.enum/cpp/natural_ostream.h> |
| |
| #pragma clang diagnostic push |
| #pragma clang diagnostic ignored "-Wshadow" |
| |
| std::ostream& fidl::ostream::Formatter<::test_enum::MyStrictEnum>::Format(std::ostream& os, const ::test_enum::MyStrictEnum& value) { |
| os << "test_enum::MyStrictEnum"; |
| os << "::"; |
| switch (value) { |
| case ::test_enum::MyStrictEnum::kFoo: |
| os << "kFoo"; |
| break; |
| case ::test_enum::MyStrictEnum::kBar: |
| os << "kBar"; |
| break; |
| default: |
| os << "UNKNOWN(" << static_cast<uint32_t>(value) << ")"; |
| } |
| return os; |
| } |
| std::ostream& fidl::ostream::Formatter<::test_enum::MyFlexibleEnum>::Format(std::ostream& os, const ::test_enum::MyFlexibleEnum& value) { |
| os << "test_enum::MyFlexibleEnum"; |
| os << "::"; |
| switch (value) { |
| case ::test_enum::MyFlexibleEnum::kFoo: |
| os << "kFoo"; |
| break; |
| case ::test_enum::MyFlexibleEnum::kBar: |
| os << "kBar"; |
| break; |
| default: |
| os << "UNKNOWN(" << static_cast<uint32_t>(value) << ")"; |
| } |
| return os; |
| } |
| std::ostream& fidl::ostream::Formatter<::test_enum::MyFlexibleEnumWithCustomUnknown>::Format(std::ostream& os, const ::test_enum::MyFlexibleEnumWithCustomUnknown& value) { |
| os << "test_enum::MyFlexibleEnumWithCustomUnknown"; |
| os << "::"; |
| switch (value) { |
| case ::test_enum::MyFlexibleEnumWithCustomUnknown::kFoo: |
| os << "kFoo"; |
| break; |
| case ::test_enum::MyFlexibleEnumWithCustomUnknown::kBar: |
| os << "kBar"; |
| break; |
| case ::test_enum::MyFlexibleEnumWithCustomUnknown::kCustomUnknown: |
| os << "kCustomUnknown"; |
| break; |
| default: |
| os << "UNKNOWN(" << static_cast<uint32_t>(value) << ")"; |
| } |
| return os; |
| } |
| std::ostream& fidl::ostream::Formatter<::test_enum::MyEmptyFlexibleEnum>::Format(std::ostream& os, const ::test_enum::MyEmptyFlexibleEnum& value) { |
| os << "test_enum::MyEmptyFlexibleEnum"; |
| os << "::"; |
| switch (value) { |
| default: |
| os << "UNKNOWN(" << static_cast<uint32_t>(value) << ")"; |
| } |
| return os; |
| } |
| |
| namespace test_enum { |
| |
| std::ostream& operator<<(std::ostream& os, const ::test_enum::MyStrictEnum& value) { |
| return fidl::ostream::Formatter<::test_enum::MyStrictEnum>::Format(os, value); |
| } |
| |
| std::ostream& operator<<(std::ostream& os, const ::test_enum::MyFlexibleEnum& value) { |
| return fidl::ostream::Formatter<::test_enum::MyFlexibleEnum>::Format(os, value); |
| } |
| |
| std::ostream& operator<<(std::ostream& os, const ::test_enum::MyFlexibleEnumWithCustomUnknown& value) { |
| return fidl::ostream::Formatter<::test_enum::MyFlexibleEnumWithCustomUnknown>::Format(os, value); |
| } |
| |
| std::ostream& operator<<(std::ostream& os, const ::test_enum::MyEmptyFlexibleEnum& value) { |
| return fidl::ostream::Formatter<::test_enum::MyEmptyFlexibleEnum>::Format(os, value); |
| } |
| |
| #pragma clang diagnostic pop |
| |
| } // namespace test_enum |