Bind.GL2.Generator.ReadTypeMap C# (CSharp) Метод

ReadTypeMap() публичный Метод

public ReadTypeMap ( StreamReader specFile ) : string>.Dictionary
specFile System.IO.StreamReader
Результат string>.Dictionary
        public virtual Dictionary<string, string> ReadTypeMap(StreamReader specFile)
        {
            Console.WriteLine("Reading opengl types.");
            Dictionary<string, string> GLTypes = new Dictionary<string, string>();

            if (specFile == null)
                return GLTypes;

            do
            {
                string line = specFile.ReadLine();

                if (String.IsNullOrEmpty(line) || line.StartsWith("#"))
                    continue;

                string[] words = line.Split(" ,*\t".ToCharArray(), StringSplitOptions.RemoveEmptyEntries);

                if (words[0].ToLower() == "void")
                {
                    // Special case for "void" -> "". We make it "void" -> "void"
                    GLTypes.Add(words[0], "void");
                }
                else if (words[0] == "VoidPointer" || words[0] == "ConstVoidPointer")
                {
                    // "(Const)VoidPointer" -> "void*"
                    GLTypes.Add(words[0], "void*");
                }
                else if (words[0] == "CharPointer" || words[0] == "charPointerARB")
                {
                    // The typematching logic cannot handle pointers to pointers, e.g. CharPointer* -> char** -> string* -> string[].
                    // Hence we give it a push.
                    // Note: When both CurrentType == "String" and Pointer == true, the typematching is hardcoded to use
                    // String[] or StringBuilder[].
                    GLTypes.Add(words[0], "String");
                }
                /*else if (words[0].Contains("Pointer"))
                {
                    GLTypes.Add(words[0], words[1].Replace("Pointer", "*"));
                }*/
                else if (words[1].Contains("GLvoid"))
                {
                    GLTypes.Add(words[0], "void");
                }
                else
                {
                    GLTypes.Add(words[0], words[1]);
                }
            }
            while (!specFile.EndOfStream);

            return GLTypes;
        }