| // WARNING: This file is machine generated by fidlgen. |
| |
| // fidl_experiment = output_index_json |
| |
| #include <fidl/test.anonymous/cpp/common_types.h> |
| |
| #pragma clang diagnostic push |
| #pragma clang diagnostic ignored "-Wshadow" |
| |
| size_t fidl::internal::DisplayError<::test_anonymous::Op>::Format( |
| const ::test_anonymous::Op& value, char* destination, size_t capacity) { |
| const char* member_name = [&]() -> const char* { |
| switch (static_cast<uint32_t>(value)) { |
| case 1u: |
| return "ADD"; |
| case 2u: |
| return "MUL"; |
| case 3u: |
| return "DIV"; |
| default: |
| return "[UNKNOWN]"; |
| } |
| }(); |
| size_t written = std::snprintf(destination, capacity, "%s.%s (value: %u)", |
| "test.anonymous/Op", member_name, static_cast<uint32_t>(value)); |
| return std::min(written, capacity - 1); |
| } |
| |
| size_t fidl::internal::DisplayError<::test_anonymous::SomeProtocolSomeMethodError>::Format( |
| const ::test_anonymous::SomeProtocolSomeMethodError& value, char* destination, size_t capacity) { |
| const char* member_name = [&]() -> const char* { |
| switch (static_cast<uint32_t>(value)) { |
| case 1u: |
| return "ERROR_ONE"; |
| case 2u: |
| return "ERROR_TWO"; |
| default: |
| return "[UNKNOWN]"; |
| } |
| }(); |
| size_t written = std::snprintf(destination, capacity, "%s.%s (value: %u)", |
| "test.anonymous/SomeProtocol_SomeMethod_Error", member_name, static_cast<uint32_t>(value)); |
| return std::min(written, capacity - 1); |
| } |
| |
| #pragma clang diagnostic pop |