void write()

in cppwinrt/type_writers.h [388:465]


        void write(GenericTypeInstSig const& type)
        {
            if (abi_types)
            {
                write("void*");
            }
            else
            {
                auto generic_type = type.GenericType();
                auto[ns, name] = get_type_namespace_and_name(generic_type);
                name.remove_suffix(name.size() - name.rfind('`'));
                add_depends(find_required(generic_type));

                if (consume_types)
                {
                    static constexpr std::string_view iterable("winrt::Windows::Foundation::Collections::IIterable<"sv);
                    static constexpr std::string_view vector_view("winrt::Windows::Foundation::Collections::IVectorView<"sv);
                    static constexpr std::string_view map_view("winrt::Windows::Foundation::Collections::IMapView<"sv);
                    static constexpr std::string_view vector("winrt::Windows::Foundation::Collections::IVector<"sv);
                    static constexpr std::string_view map("winrt::Windows::Foundation::Collections::IMap<"sv);

                    consume_types = false;
                    auto full_name = write_temp("winrt::@::%<%>", ns, name, bind_list(", ", type.GenericArgs()));
                    consume_types = true;

                    if (starts_with(full_name, iterable))
                    {
                        if (async_types)
                        {
                            write("param::async_iterable%", full_name.substr(iterable.size() - 1));
                        }
                        else
                        {
                            write("param::iterable%", full_name.substr(iterable.size() - 1));
                        }
                    }
                    else if (starts_with(full_name, vector_view))
                    {
                        if (async_types)
                        {
                            write("param::async_vector_view%", full_name.substr(vector_view.size() - 1));
                        }
                        else
                        {
                            write("param::vector_view%", full_name.substr(vector_view.size() - 1));
                        }
                    }

                    else if (starts_with(full_name, map_view))
                    {
                        if (async_types)
                        {
                            write("param::async_map_view%", full_name.substr(map_view.size() - 1));
                        }
                        else
                        {
                            write("param::map_view%", full_name.substr(map_view.size() - 1));
                        }
                    }
                    else if (starts_with(full_name, vector))
                    {
                        write("param::vector%", full_name.substr(vector.size() - 1));
                    }
                    else if (starts_with(full_name, map))
                    {
                        write("param::map%", full_name.substr(map.size() - 1));
                    }
                    else
                    {
                        write(full_name);
                    }
                }
                else
                {
                    write("winrt::@::%<%>", ns, name, bind_list(", ", type.GenericArgs()));
                }
            }
        }