コード例 #1
0
        protected void WriteCommandField(SpecCommand info)
        {
        #line default
        #line hidden

        #line 18 "F:\Projects\Crow.Graphics.OpenGl\Crow.Graphics.Vulkan.SpecGen\CommandTemplete.tt"
            this.Write("/// <summary>");


        #line default
        #line hidden

        #line 19 "F:\Projects\Crow.Graphics.OpenGl\Crow.Graphics.Vulkan.SpecGen\CommandTemplete.tt"
            this.Write(this.ToStringHelper.ToStringWithCulture(info.DebugLog()));


        #line default
        #line hidden

        #line 19 "F:\Projects\Crow.Graphics.OpenGl\Crow.Graphics.Vulkan.SpecGen\CommandTemplete.tt"
            this.Write("</summary>\r\npublic readonly ");


        #line default
        #line hidden

        #line 20 "F:\Projects\Crow.Graphics.OpenGl\Crow.Graphics.Vulkan.SpecGen\CommandTemplete.tt"
            this.Write(this.ToStringHelper.ToStringWithCulture(info.MapName));


        #line default
        #line hidden

        #line 20 "F:\Projects\Crow.Graphics.OpenGl\Crow.Graphics.Vulkan.SpecGen\CommandTemplete.tt"
            this.Write("Delegate ");


        #line default
        #line hidden

        #line 20 "F:\Projects\Crow.Graphics.OpenGl\Crow.Graphics.Vulkan.SpecGen\CommandTemplete.tt"
            this.Write(this.ToStringHelper.ToStringWithCulture(info.MapName));


        #line default
        #line hidden

        #line 20 "F:\Projects\Crow.Graphics.OpenGl\Crow.Graphics.Vulkan.SpecGen\CommandTemplete.tt"
            this.Write(";\r\n");


        #line default
        #line hidden

        #line 21 "F:\Projects\Crow.Graphics.OpenGl\Crow.Graphics.Vulkan.SpecGen\CommandTemplete.tt"
        }
コード例 #2
0
ファイル: Program.cs プロジェクト: Benkei/Crow.Framework
        static void ParseCommand(XPathNavigator node)
        {
            var result = new SpecCommand();

            result.Successcodes = node.GetAttribute("successcodes");
            result.Errorcodes   = node.GetAttribute("errorcodes");

            var proto = node.SelectSingleNode("proto");
            var rType = proto.SelectSingleNode("type");

            result.Return          = GetSpecType(rType.Value);
            result.ReturnIsPointer = proto.InnerXml.Contains("*");

            result.Name = result.MapName = proto.SelectSingleNode("name").Value;

            commandMap.Add(result.Name, result);

            result.Parameters = new List <SpecField> ();
            foreach (XPathNavigator param in node.Select("param"))
            {
                var field = new SpecField();

                //field.Optional = param.ReadAttribute<bool> ( "optional" );

                XPathNavigator paramNode;
                paramNode  = param.SelectSingleNode("type");
                field.Type = GetSpecType(paramNode.Value);
                if (paramNode.MoveToNext(XPathNodeType.Text))
                {
                    field.IsPointer = paramNode.Value.Contains("*");
                }

                paramNode  = param.SelectSingleNode("name");
                field.Name = field.MapName = paramNode.Value;

                result.Parameters.Add(field);
            }

            //foreach ( XmlNode param in node.SelectNodes ( "validity/usage" ) )
            //{
            //	result.Summary += param.InnerText + "\n";
            //}
        }
コード例 #3
0
        protected void WriteCommandDelegate(SpecCommand info)
        {
            var type = info.IsReturnVoid ? "void" : info.Return.FinalTypeName();


        #line default
        #line hidden

        #line 9 "F:\Projects\Crow.Graphics.OpenGl\Crow.Graphics.Vulkan.SpecGen\CommandTemplete.tt"
            this.Write("/// <summary>");


        #line default
        #line hidden

        #line 10 "F:\Projects\Crow.Graphics.OpenGl\Crow.Graphics.Vulkan.SpecGen\CommandTemplete.tt"
            this.Write(this.ToStringHelper.ToStringWithCulture(info.DebugLog()));


        #line default
        #line hidden

        #line 10 "F:\Projects\Crow.Graphics.OpenGl\Crow.Graphics.Vulkan.SpecGen\CommandTemplete.tt"
            this.Write("</summary>\r\n[SuppressUnmanagedCodeSecurity, UnmanagedFunctionPointer(CallingConve" +
                       "ntion.Winapi)]\r\npublic unsafe delegate ");


        #line default
        #line hidden

        #line 12 "F:\Projects\Crow.Graphics.OpenGl\Crow.Graphics.Vulkan.SpecGen\CommandTemplete.tt"
            this.Write(this.ToStringHelper.ToStringWithCulture(type));


        #line default
        #line hidden

        #line 12 "F:\Projects\Crow.Graphics.OpenGl\Crow.Graphics.Vulkan.SpecGen\CommandTemplete.tt"
            this.Write(" ");


        #line default
        #line hidden

        #line 12 "F:\Projects\Crow.Graphics.OpenGl\Crow.Graphics.Vulkan.SpecGen\CommandTemplete.tt"
            this.Write(this.ToStringHelper.ToStringWithCulture(info.MapName));


        #line default
        #line hidden

        #line 12 "F:\Projects\Crow.Graphics.OpenGl\Crow.Graphics.Vulkan.SpecGen\CommandTemplete.tt"
            this.Write("Delegate (");


        #line default
        #line hidden

        #line 12 "F:\Projects\Crow.Graphics.OpenGl\Crow.Graphics.Vulkan.SpecGen\CommandTemplete.tt"
            WriteParameters(info.Parameters);

        #line default
        #line hidden

        #line 12 "F:\Projects\Crow.Graphics.OpenGl\Crow.Graphics.Vulkan.SpecGen\CommandTemplete.tt"
            this.Write(");\r\n");


        #line default
        #line hidden

        #line 13 "F:\Projects\Crow.Graphics.OpenGl\Crow.Graphics.Vulkan.SpecGen\CommandTemplete.tt"
        }