Пример #1
0
        string INdrFormatter.FormatComProxy(NdrComProxyDefinition com_proxy)
        {
            NdrStringBuilder builder = new NdrStringBuilder();

            string base_name = this.IidToName(com_proxy.BaseIid);

            if (base_name == null)
            {
                string unknown_iid = $"Unknown IID {com_proxy.BaseIid}";
                string comment     = (this as INdrFormatterInternal).FormatComment(unknown_iid);
                base_name = $"{comment} IUnknown";
            }

            builder.AppendLine(
                "class __declspec(uuid(\"{0}\")) {1} : public {2} {{\npublic:",
                com_proxy.Iid,
                (this as INdrFormatterInternal).DemangleComName(com_proxy.Name),
                base_name
                );

            builder.PushIndent(' ', 4);
            foreach (NdrProcedureDefinition proc in com_proxy.Procedures)
            {
                builder.AppendLine(this.FormatProcedure(proc));
            }
            builder.PopIndent();
            builder.AppendLine("};").AppendLine();
            return(builder.ToString());
        }
Пример #2
0
        internal string Format(NdrFormatter context)
        {
            NdrStringBuilder builder = new NdrStringBuilder();

            builder.AppendLine("[uuid(\"{0}\"), version({1})]", InterfaceId, InterfaceVersion);
            builder.AppendLine("interface intf_{0} {{", InterfaceId.ToString().Replace('-', '_'));
            builder.PushIndent(' ', 4);
            foreach (NdrProcedureDefinition proc in Procedures)
            {
                builder.AppendLine(proc.FormatProcedure(context));
            }
            builder.PopIndent();
            builder.AppendLine("}").AppendLine();
            return(builder.ToString());
        }
        internal string Format(NdrFormatter context)
        {
            NdrStringBuilder builder = new NdrStringBuilder();

            builder.AppendLine("[Guid(\"{0}\")]", Iid);
            string base_name = context.IidToName(BaseIid);

            if (base_name == null)
            {
                base_name = $"/* Unknown IID {BaseIid} */ IUnknown";
            }

            builder.AppendLine("interface {0} : {1} {{", context.DemangleComName(Name), base_name);
            builder.PushIndent(' ', 4);
            foreach (NdrProcedureDefinition proc in Procedures)
            {
                builder.AppendLine(proc.FormatProcedure(context));
            }
            builder.PopIndent();
            builder.AppendLine("}").AppendLine();
            return(builder.ToString());
        }