| // WARNING: This file is machine generated by fidlgen. |
| |
| // fidl_experiment = output_index_json |
| |
| #include <fidl/test.doccomments/cpp/natural_ostream.h> |
| |
| #pragma clang diagnostic push |
| #pragma clang diagnostic ignored "-Wshadow" |
| |
| std::ostream& fidl::ostream::Formatter<::test_doccomments::MyStrictEnum>::Format(std::ostream& os, const ::test_doccomments::MyStrictEnum& value) { |
| os << "test_doccomments::MyStrictEnum"; |
| os << "::"; |
| switch (value) { |
| case ::test_doccomments::MyStrictEnum::kFoo: |
| os << "kFoo"; |
| break; |
| case ::test_doccomments::MyStrictEnum::kBar: |
| os << "kBar"; |
| break; |
| default: |
| os << "UNKNOWN(" << static_cast<uint32_t>(value) << ")"; |
| } |
| return os; |
| } |
| std::ostream& fidl::ostream::Formatter<::test_doccomments::MyFlexibleEnum>::Format(std::ostream& os, const ::test_doccomments::MyFlexibleEnum& value) { |
| os << "test_doccomments::MyFlexibleEnum"; |
| os << "::"; |
| switch (value) { |
| case ::test_doccomments::MyFlexibleEnum::kFoo: |
| os << "kFoo"; |
| break; |
| case ::test_doccomments::MyFlexibleEnum::kBar: |
| os << "kBar"; |
| break; |
| default: |
| os << "UNKNOWN(" << static_cast<uint32_t>(value) << ")"; |
| } |
| return os; |
| } |
| std::ostream& fidl::ostream::Formatter<::test_doccomments::MyStrictBits>::Format(std::ostream& os, const ::test_doccomments::MyStrictBits& value) { |
| os << "test_doccomments::MyStrictBits"; |
| os << "("; |
| bool first = true; |
| if (value & ::test_doccomments::MyStrictBits::kMyFirstBit) { |
| if (!first) os << "|"; |
| first = false; |
| os << "kMyFirstBit"; |
| } |
| if (value & ::test_doccomments::MyStrictBits::kMyOtherBit) { |
| if (!first) os << "|"; |
| first = false; |
| os << "kMyOtherBit"; |
| } |
| os << ")"; |
| return os; |
| } |
| std::ostream& fidl::ostream::Formatter<::test_doccomments::MyFlexibleBits>::Format(std::ostream& os, const ::test_doccomments::MyFlexibleBits& value) { |
| os << "test_doccomments::MyFlexibleBits"; |
| os << "("; |
| bool first = true; |
| if (value & ::test_doccomments::MyFlexibleBits::kMyFirstBit) { |
| if (!first) os << "|"; |
| first = false; |
| os << "kMyFirstBit"; |
| } |
| if (value & ::test_doccomments::MyFlexibleBits::kMyOtherBit) { |
| if (!first) os << "|"; |
| first = false; |
| os << "kMyOtherBit"; |
| } |
| if (value.has_unknown_bits()) { |
| if (!first) os << "|"; |
| os << static_cast<uint32_t>(value.unknown_bits()); |
| } |
| os << ")"; |
| return os; |
| } |
| std::ostream& fidl::ostream::Formatter<::test_doccomments::Struct>::Format(std::ostream& os, const ::test_doccomments::Struct& value) { |
| os << "test_doccomments::Struct"; |
| os << "{ "; |
| os << "field"; |
| os << " = " << fidl::ostream::Formatted<int32_t>(value.field()) << ", "; |
| os << "}"; |
| return os; |
| } |
| std::ostream& fidl::ostream::Formatter<::test_doccomments::Table>::Format(std::ostream& os, const ::test_doccomments::Table& value) { |
| os << "test_doccomments::Table"; |
| os << "{ "; |
| if (value.field().has_value()) { |
| os << "field"; |
| os << " = " << fidl::ostream::Formatted<int32_t>(value.field().value()) << ", "; |
| } |
| os << "}"; |
| return os; |
| } |
| std::ostream& fidl::ostream::Formatter<::test_doccomments::StrictUnion>::Format(std::ostream& os, const ::test_doccomments::StrictUnion& value) { |
| os << "test_doccomments::StrictUnion::"; |
| switch (value.Which()) { |
| case ::test_doccomments::StrictUnion::Tag::kField: |
| os << "field(" << fidl::ostream::Formatted<int32_t>(value.field().value()) << ")"; |
| break; |
| default: |
| os << "Unknown"; |
| } |
| return os; |
| } |
| std::ostream& fidl::ostream::Formatter<::test_doccomments::FlexibleUnion>::Format(std::ostream& os, const ::test_doccomments::FlexibleUnion& value) { |
| os << "test_doccomments::FlexibleUnion::"; |
| switch (value.Which()) { |
| case ::test_doccomments::FlexibleUnion::Tag::kField: |
| os << "field(" << fidl::ostream::Formatted<int32_t>(value.field().value()) << ")"; |
| break; |
| default: |
| os << "Unknown"; |
| } |
| return os; |
| } |
| |
| namespace test_doccomments { |
| |
| std::ostream& operator<<(std::ostream& os, const ::test_doccomments::MyStrictBits& value) { |
| return fidl::ostream::Formatter<::test_doccomments::MyStrictBits>::Format(os, value); |
| } |
| |
| std::ostream& operator<<(std::ostream& os, const ::test_doccomments::MyFlexibleBits& value) { |
| return fidl::ostream::Formatter<::test_doccomments::MyFlexibleBits>::Format(os, value); |
| } |
| |
| std::ostream& operator<<(std::ostream& os, const ::test_doccomments::MyStrictEnum& value) { |
| return fidl::ostream::Formatter<::test_doccomments::MyStrictEnum>::Format(os, value); |
| } |
| |
| std::ostream& operator<<(std::ostream& os, const ::test_doccomments::MyFlexibleEnum& value) { |
| return fidl::ostream::Formatter<::test_doccomments::MyFlexibleEnum>::Format(os, value); |
| } |
| |
| std::ostream& operator<<(std::ostream& os, const ::test_doccomments::Struct& value) { |
| return fidl::ostream::Formatter<::test_doccomments::Struct>::Format(os, value); |
| } |
| |
| std::ostream& operator<<(std::ostream& os, const ::test_doccomments::StrictUnion& value) { |
| return fidl::ostream::Formatter<::test_doccomments::StrictUnion>::Format(os, value); |
| } |
| |
| std::ostream& operator<<(std::ostream& os, const ::test_doccomments::FlexibleUnion& value) { |
| return fidl::ostream::Formatter<::test_doccomments::FlexibleUnion>::Format(os, value); |
| } |
| |
| std::ostream& operator<<(std::ostream& os, const ::test_doccomments::Table& value) { |
| return fidl::ostream::Formatter<::test_doccomments::Table>::Format(os, value); |
| } |
| |
| #pragma clang diagnostic pop |
| |
| } // namespace test_doccomments |