| // WARNING: This file is machine generated by fidlgen. |
| |
| // fidl_experiment = output_index_json |
| |
| #include <fidl/test.bits/cpp/natural_ostream.h> |
| |
| #pragma clang diagnostic push |
| #pragma clang diagnostic ignored "-Wshadow" |
| |
| std::ostream& fidl::ostream::Formatter<::test_bits::MyBits>::Format(std::ostream& os, const ::test_bits::MyBits& value) { |
| os << "test_bits::MyBits"; |
| os << "("; |
| bool first = true; |
| if (value & ::test_bits::MyBits::kMyFirstBit) { |
| if (!first) os << "|"; |
| first = false; |
| os << "kMyFirstBit"; |
| } |
| if (value & ::test_bits::MyBits::kMyOtherBit) { |
| if (!first) os << "|"; |
| first = false; |
| os << "kMyOtherBit"; |
| } |
| if (value & ::test_bits::MyBits::kMask_) { |
| if (!first) os << "|"; |
| first = false; |
| os << "kMask_"; |
| } |
| os << ")"; |
| return os; |
| } |
| std::ostream& fidl::ostream::Formatter<::test_bits::StrictBits>::Format(std::ostream& os, const ::test_bits::StrictBits& value) { |
| os << "test_bits::StrictBits"; |
| os << "("; |
| bool first = true; |
| if (value & ::test_bits::StrictBits::kSmallest) { |
| if (!first) os << "|"; |
| first = false; |
| os << "kSmallest"; |
| } |
| if (value & ::test_bits::StrictBits::kBiggest) { |
| if (!first) os << "|"; |
| first = false; |
| os << "kBiggest"; |
| } |
| os << ")"; |
| return os; |
| } |
| std::ostream& fidl::ostream::Formatter<::test_bits::FlexibleBits>::Format(std::ostream& os, const ::test_bits::FlexibleBits& value) { |
| os << "test_bits::FlexibleBits"; |
| os << "("; |
| bool first = true; |
| if (value & ::test_bits::FlexibleBits::kSmallest) { |
| if (!first) os << "|"; |
| first = false; |
| os << "kSmallest"; |
| } |
| if (value & ::test_bits::FlexibleBits::kBiggest) { |
| if (!first) os << "|"; |
| first = false; |
| os << "kBiggest"; |
| } |
| if (value.has_unknown_bits()) { |
| if (!first) os << "|"; |
| os << static_cast<uint64_t>(value.unknown_bits()); |
| } |
| os << ")"; |
| return os; |
| } |
| std::ostream& fidl::ostream::Formatter<::test_bits::EmptyBits>::Format(std::ostream& os, const ::test_bits::EmptyBits& value) { |
| os << "test_bits::EmptyBits"; |
| os << "("; |
| bool first = true; |
| if (value.has_unknown_bits()) { |
| if (!first) os << "|"; |
| os << static_cast<uint32_t>(value.unknown_bits()); |
| } |
| os << ")"; |
| return os; |
| } |
| |
| namespace test_bits { |
| |
| std::ostream& operator<<(std::ostream& os, const ::test_bits::MyBits& value) { |
| return fidl::ostream::Formatter<::test_bits::MyBits>::Format(os, value); |
| } |
| |
| std::ostream& operator<<(std::ostream& os, const ::test_bits::StrictBits& value) { |
| return fidl::ostream::Formatter<::test_bits::StrictBits>::Format(os, value); |
| } |
| |
| std::ostream& operator<<(std::ostream& os, const ::test_bits::FlexibleBits& value) { |
| return fidl::ostream::Formatter<::test_bits::FlexibleBits>::Format(os, value); |
| } |
| |
| std::ostream& operator<<(std::ostream& os, const ::test_bits::EmptyBits& value) { |
| return fidl::ostream::Formatter<::test_bits::EmptyBits>::Format(os, value); |
| } |
| |
| #pragma clang diagnostic pop |
| |
| } // namespace test_bits |