コード例 #1
0
        public string getCppArgCall(WrapperGenerator generator)
        {
            StringBuilder buffer = new StringBuilder();

            for (int i = 0; i < args.Count; i++)
            {
                //Comma
                if (i > 0)
                {
                    buffer.Append(", ");
                }

                //Arg
                WrapMethodArg wrapArg = args[i];
                WrapType      type    = generator.findType(wrapArg.type);

                //Check if struct
                if (type is WrapStruct && !wrapArg.moveOut)
                {
                    buffer.Append("*");
                }
                else if (wrapArg.cppRef)
                {
                    buffer.Append("*");
                }

                if (String.IsNullOrEmpty(type.cppInConvert))
                {
                    buffer.Append(wrapArg.name);
                }
                else
                {
                    if (wrapArg.moveOut)
                    {
                        buffer.Append("&");
                    }

                    buffer.Append("arg");
                    buffer.Append(i);
                }
            }
            return(buffer.ToString());
        }
コード例 #2
0
        public string getCppArgDef(WrapperGenerator generator)
        {
            StringBuilder buffer = new StringBuilder();

            for (int i = 0; i < args.Count; i++)
            {
                //Comma
                if (i > 0)
                {
                    buffer.Append(", ");
                }

                //Arg
                WrapMethodArg wrapArg = args[i];
                buffer.Append(generator.findType(wrapArg.type).cppType);
                buffer.Append(" ");
                buffer.Append(wrapArg.name);
            }
            return(buffer.ToString());
        }