示例#1
0
            private bool GetRemapInfo(string fullName, out List <AttributeSyntax> listAttributes, string currentType, out string newType, out string newName)
            {
                if (!string.IsNullOrEmpty(fullName) && this.remaps.TryGetValue(fullName, out string remapData))
                {
                    var ret = EncodeHelpers.DecodeRemap(remapData, out listAttributes, out newType, out newName);
                    if (newType != null)
                    {
                        // Try to keep the pointers at the same level if we're replacing
                        // a uint or int. The mismatch can happen in the auto-generated
                        // enum remaps which don't know if the params/fields getting replaced
                        // are pointers or not
                        if (currentType.StartsWith("uint") || currentType.StartsWith("int") || currentType.StartsWith("short") || currentType.StartsWith("ushort"))
                        {
                            int starIndex = currentType.IndexOf('*');
                            if (starIndex != -1 && newType.IndexOf('*') == -1)
                            {
                                newType += currentType.Substring(starIndex);
                            }
                        }
                        else
                        {
                            newType = null;
                        }
                    }

                    return(ret);
                }

                listAttributes = null;
                newType        = null;
                newName        = null;

                return(false);
            }
示例#2
0
            private bool GetRemapInfo(string fullName, out List <AttributeSyntax> listAttributes, out string newType, out string newName)
            {
                if (!string.IsNullOrEmpty(fullName) && this.remaps.TryGetValue(fullName, out string remapData))
                {
                    return(EncodeHelpers.DecodeRemap(remapData, out listAttributes, out newType, out newName));
                }

                listAttributes = null;
                newType        = null;
                newName        = null;

                return(false);
            }