| // WARNING: This file is machine generated by fidlgen. |
| |
| // fidl_experiment = output_index_json |
| |
| #include <fidl/test.anonymous/cpp/natural_ostream.h> |
| |
| #pragma clang diagnostic push |
| #pragma clang diagnostic ignored "-Wshadow" |
| |
| std::ostream& fidl::ostream::Formatter<::test_anonymous::Op>::Format(std::ostream& os, const ::test_anonymous::Op& value) { |
| os << "test_anonymous::Op"; |
| os << "::"; |
| switch (value) { |
| case ::test_anonymous::Op::kAdd: |
| os << "kAdd"; |
| break; |
| case ::test_anonymous::Op::kMul: |
| os << "kMul"; |
| break; |
| case ::test_anonymous::Op::kDiv: |
| os << "kDiv"; |
| break; |
| default: |
| os << "UNKNOWN(" << static_cast<uint32_t>(value) << ")"; |
| } |
| return os; |
| } |
| std::ostream& fidl::ostream::Formatter<::test_anonymous::SomeProtocolSomeMethodError>::Format(std::ostream& os, const ::test_anonymous::SomeProtocolSomeMethodError& value) { |
| os << "test_anonymous::SomeProtocolSomeMethodError"; |
| os << "::"; |
| switch (value) { |
| case ::test_anonymous::SomeProtocolSomeMethodError::kErrorOne: |
| os << "kErrorOne"; |
| break; |
| case ::test_anonymous::SomeProtocolSomeMethodError::kErrorTwo: |
| os << "kErrorTwo"; |
| break; |
| default: |
| os << "UNKNOWN(" << static_cast<uint32_t>(value) << ")"; |
| } |
| return os; |
| } |
| std::ostream& fidl::ostream::Formatter<::test_anonymous::Flags>::Format(std::ostream& os, const ::test_anonymous::Flags& value) { |
| os << "test_anonymous::Flags"; |
| os << "("; |
| bool first = true; |
| if (value & ::test_anonymous::Flags::kInline) { |
| if (!first) os << "|"; |
| first = false; |
| os << "kInline"; |
| } |
| if (value.has_unknown_bits()) { |
| if (!first) os << "|"; |
| os << static_cast<uint16_t>(value.unknown_bits()); |
| } |
| os << ")"; |
| return os; |
| } |
| std::ostream& fidl::ostream::Formatter<::test_anonymous::BitsMember>::Format(std::ostream& os, const ::test_anonymous::BitsMember& value) { |
| os << "test_anonymous::BitsMember"; |
| os << "("; |
| bool first = true; |
| if (value & ::test_anonymous::BitsMember::kBitOne) { |
| if (!first) os << "|"; |
| first = false; |
| os << "kBitOne"; |
| } |
| if (value & ::test_anonymous::BitsMember::kBitTwo) { |
| if (!first) os << "|"; |
| first = false; |
| os << "kBitTwo"; |
| } |
| 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_anonymous::OverrideTest>::Format(std::ostream& os, const ::test_anonymous::OverrideTest& value) { |
| os << "test_anonymous::OverrideTest"; |
| os << "{ "; |
| os << "op"; |
| os << " = " << fidl::ostream::Formatted<::test_anonymous::Op>(value.op()) << ", "; |
| os << "left"; |
| os << " = " << fidl::ostream::Formatted<::fidl::Box<::test_anonymous::Expression>>(value.left()) << ", "; |
| os << "right"; |
| os << " = " << fidl::ostream::Formatted<::fidl::Box<::test_anonymous::Expression>>(value.right()) << ", "; |
| os << "}"; |
| return os; |
| } |
| std::ostream& fidl::ostream::Formatter<::test_anonymous::TableData>::Format(std::ostream& os, const ::test_anonymous::TableData& value) { |
| os << "test_anonymous::TableData"; |
| os << "{ "; |
| os << "data"; |
| os << " = " << fidl::ostream::Formatted<uint8_t>(value.data()) << ", "; |
| os << "}"; |
| return os; |
| } |
| std::ostream& fidl::ostream::Formatter<::test_anonymous::SomeProtocolSomeMethodRequest>::Format(std::ostream& os, const ::test_anonymous::SomeProtocolSomeMethodRequest& value) { |
| os << "test_anonymous::SomeProtocolSomeMethodRequest"; |
| os << "{ "; |
| os << "union_member"; |
| os << " = " << fidl::ostream::Formatted<::test_anonymous::UnionMember>(value.union_member()) << ", "; |
| os << "table_member"; |
| os << " = " << fidl::ostream::Formatted<::test_anonymous::TableMember>(value.table_member()) << ", "; |
| os << "}"; |
| return os; |
| } |
| std::ostream& fidl::ostream::Formatter<::test_anonymous::SomeProtocolSomeMethodResponse>::Format(std::ostream& os, const ::test_anonymous::SomeProtocolSomeMethodResponse& value) { |
| os << "test_anonymous::SomeProtocolSomeMethodResponse"; |
| os << "{ "; |
| os << "bits_member"; |
| os << " = " << fidl::ostream::Formatted<::test_anonymous::BitsMember>(value.bits_member()) << ", "; |
| os << "}"; |
| return os; |
| } |
| std::ostream& fidl::ostream::Formatter<::test_anonymous::FunctionApplication>::Format(std::ostream& os, const ::test_anonymous::FunctionApplication& value) { |
| os << "test_anonymous::FunctionApplication"; |
| os << "{ "; |
| if (value.func().has_value()) { |
| os << "func"; |
| os << " = " << fidl::ostream::Formatted<::std::string>(value.func().value()) << ", "; |
| } |
| if (value.args().has_value()) { |
| os << "args"; |
| os << " = " << fidl::ostream::Formatted<::std::vector<::fidl::Box<::test_anonymous::Expression>>>(value.args().value()) << ", "; |
| } |
| if (value.flags().has_value()) { |
| os << "flags"; |
| os << " = " << fidl::ostream::Formatted<::test_anonymous::Flags>(value.flags().value()) << ", "; |
| } |
| os << "}"; |
| return os; |
| } |
| std::ostream& fidl::ostream::Formatter<::test_anonymous::TableMember>::Format(std::ostream& os, const ::test_anonymous::TableMember& value) { |
| os << "test_anonymous::TableMember"; |
| os << "{ "; |
| if (value.table_data().has_value()) { |
| os << "table_data"; |
| os << " = " << fidl::ostream::Formatted<::std::vector<::test_anonymous::TableData>>(value.table_data().value()) << ", "; |
| } |
| os << "}"; |
| return os; |
| } |
| std::ostream& fidl::ostream::Formatter<::test_anonymous::Expression>::Format(std::ostream& os, const ::test_anonymous::Expression& value) { |
| os << "test_anonymous::Expression::"; |
| switch (value.Which()) { |
| case ::test_anonymous::Expression::Tag::kValue: |
| os << "value(" << fidl::ostream::Formatted<uint64_t>(value.value().value()) << ")"; |
| break; |
| case ::test_anonymous::Expression::Tag::kBinOp: |
| os << "bin_op(" << fidl::ostream::Formatted<::test_anonymous::OverrideTest>(value.bin_op().value()) << ")"; |
| break; |
| case ::test_anonymous::Expression::Tag::kFunctionApplication: |
| os << "function_application(" << fidl::ostream::Formatted<::test_anonymous::FunctionApplication>(value.function_application().value()) << ")"; |
| break; |
| default: |
| os << "Unknown"; |
| } |
| return os; |
| } |
| std::ostream& fidl::ostream::Formatter<::test_anonymous::UnionMember>::Format(std::ostream& os, const ::test_anonymous::UnionMember& value) { |
| os << "test_anonymous::UnionMember::"; |
| switch (value.Which()) { |
| case ::test_anonymous::UnionMember::Tag::kUnionData: |
| os << "union_data(" << fidl::ostream::Formatted<uint8_t>(value.union_data().value()) << ")"; |
| break; |
| default: |
| os << "Unknown"; |
| } |
| return os; |
| } |
| std::ostream& fidl::ostream::Formatter<::test_anonymous::SomeProtocolSomeMethodResult>::Format(std::ostream& os, const ::test_anonymous::SomeProtocolSomeMethodResult& value) { |
| os << "test_anonymous::SomeProtocolSomeMethodResult::"; |
| switch (value.Which()) { |
| case ::test_anonymous::SomeProtocolSomeMethodResult::Tag::kResponse: |
| os << "response(" << fidl::ostream::Formatted<::test_anonymous::SomeProtocolSomeMethodResponse>(value.response().value()) << ")"; |
| break; |
| case ::test_anonymous::SomeProtocolSomeMethodResult::Tag::kErr: |
| os << "err(" << fidl::ostream::Formatted<::test_anonymous::SomeProtocolSomeMethodError>(value.err().value()) << ")"; |
| break; |
| default: |
| os << "Unknown"; |
| } |
| return os; |
| } |
| |
| namespace test_anonymous { |
| |
| std::ostream& operator<<(std::ostream& os, const ::test_anonymous::Op& value) { |
| return fidl::ostream::Formatter<::test_anonymous::Op>::Format(os, value); |
| } |
| |
| std::ostream& operator<<(std::ostream& os, const ::test_anonymous::OverrideTest& value) { |
| return fidl::ostream::Formatter<::test_anonymous::OverrideTest>::Format(os, value); |
| } |
| |
| std::ostream& operator<<(std::ostream& os, const ::test_anonymous::Flags& value) { |
| return fidl::ostream::Formatter<::test_anonymous::Flags>::Format(os, value); |
| } |
| |
| std::ostream& operator<<(std::ostream& os, const ::test_anonymous::FunctionApplication& value) { |
| return fidl::ostream::Formatter<::test_anonymous::FunctionApplication>::Format(os, value); |
| } |
| |
| std::ostream& operator<<(std::ostream& os, const ::test_anonymous::Expression& value) { |
| return fidl::ostream::Formatter<::test_anonymous::Expression>::Format(os, value); |
| } |
| |
| std::ostream& operator<<(std::ostream& os, const ::test_anonymous::UnionMember& value) { |
| return fidl::ostream::Formatter<::test_anonymous::UnionMember>::Format(os, value); |
| } |
| |
| std::ostream& operator<<(std::ostream& os, const ::test_anonymous::TableData& value) { |
| return fidl::ostream::Formatter<::test_anonymous::TableData>::Format(os, value); |
| } |
| |
| std::ostream& operator<<(std::ostream& os, const ::test_anonymous::TableMember& value) { |
| return fidl::ostream::Formatter<::test_anonymous::TableMember>::Format(os, value); |
| } |
| |
| std::ostream& operator<<(std::ostream& os, const ::test_anonymous::SomeProtocolSomeMethodRequest& value) { |
| return fidl::ostream::Formatter<::test_anonymous::SomeProtocolSomeMethodRequest>::Format(os, value); |
| } |
| |
| std::ostream& operator<<(std::ostream& os, const ::test_anonymous::BitsMember& value) { |
| return fidl::ostream::Formatter<::test_anonymous::BitsMember>::Format(os, value); |
| } |
| |
| std::ostream& operator<<(std::ostream& os, const ::test_anonymous::SomeProtocolSomeMethodResponse& value) { |
| return fidl::ostream::Formatter<::test_anonymous::SomeProtocolSomeMethodResponse>::Format(os, value); |
| } |
| |
| std::ostream& operator<<(std::ostream& os, const ::test_anonymous::SomeProtocolSomeMethodError& value) { |
| return fidl::ostream::Formatter<::test_anonymous::SomeProtocolSomeMethodError>::Format(os, value); |
| } |
| |
| std::ostream& operator<<(std::ostream& os, const ::test_anonymous::SomeProtocolSomeMethodResult& value) { |
| return fidl::ostream::Formatter<::test_anonymous::SomeProtocolSomeMethodResult>::Format(os, value); |
| } |
| |
| #pragma clang diagnostic pop |
| |
| } // namespace test_anonymous |